-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: README.md
- Loading branch information
Showing
12 changed files
with
156 additions
and
89 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
#Go parameters | ||
.PHONY: all install test build clean | ||
|
||
SHA=$(shell git rev-list HEAD --max-count=1 --abbrev-commit) | ||
TAG?=$(shell git tag -l --contains HEAD) | ||
VERSION=$(TAG) | ||
|
||
ifeq ($(VERSION),) | ||
VERSION := latest | ||
endif | ||
|
||
|
||
#Go parameters | ||
GOCMD=go | ||
GOINSTALL=$(GOCMD) install | ||
GOTEST=$(GOCMD) test | ||
DEP=dep | ||
.PHONY : all install test | ||
|
||
all : def | ||
DEP=dep | ||
|
||
def : | ||
@$(GOINSTALL) -ldflags '-s' | ||
all: build | ||
|
||
install: | ||
install: | ||
@$(DEP) ensure | ||
|
||
test: | ||
test: install | ||
@$(GOTEST) -v ./... | ||
|
||
build: install | ||
@$(GOINSTALL) -ldflags "-X main.version=$(VERSION)-$(SHA) -s" | ||
|
||
clean: | ||
rm -rf * | ||
rm -rf * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.