Skip to content

Commit

Permalink
build: make verbosity
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
  • Loading branch information
leodido committed Dec 15, 2020
1 parent 6d548fd commit 9074c4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ builds:
- amd64
hooks:
post:
- make build
- cat /tmp/.maintainers-generator-stderr.txt
- make VERBOSE=1 build
- mv -f bin/maintainers-generator bin/maintainers-generator_linux_amd64/

changelog:
sort: asc
sort: desc
filters:
exclude:
- "^deps:"
18 changes: 11 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
SHELL := /bin/bash

# Make is verbose in Linux. Make it silent.
# MAKEFLAGS += --silent
VERBOSE ?= 0
ifeq ($(VERBOSE), 0)
# Make is verbose in Linux: let's make it silent.
MAKEFLAGS += --silent
endif

VERSION := $(shell git describe --tags 2> /dev/null || echo "0.0.0")
BUILD := $(shell git rev-parse --short HEAD 2> /dev/null)
COMMIT := $(if $(shell git status --porcelain --untracked-files=no),${BUILD}-dirty,${BUILD})
PROJECTNAME := "maintainers-generator"
PROJECTNAME := maintainers-generator
BASE := $(shell pwd)
OUTPUT := $(BASE)/bin

Expand All @@ -17,8 +20,9 @@ LDFLAGS=-ldflags "-X=github.com/leodido/$(PROJECTNAME)/pkg/version.version=$(VER
# Redirect error output to a file, so we can show it in development mode.
STDERR := "/tmp/.$(PROJECTNAME)-stderr.txt"

.PHONY: build
build: $(GOFILES)
echo " > Building binary from: $(GOFILES)"
@echo " > Building binary..."
touch $(STDERR)
rm $(STDERR)
mkdir -p $(OUTPUT)
Expand All @@ -27,9 +31,9 @@ build: $(GOFILES)

test:
@echo " > Executing tests..."
@env GOTRACEBACK=all go test ./...
env GOTRACEBACK=all go test ./...

clean:
@echo " > Cleaning build cache"
@-rm $(OUTPUT)/$(PROJECTNAME) 2> /dev/null
@go clean
rm $(OUTPUT)/$(PROJECTNAME) 2> /dev/null
go clean

0 comments on commit 9074c4b

Please sign in to comment.