forked from roboll/helmfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ORG := $(shell basename $(realpath ..))
PKGS := $(shell go list ./... | grep -v /vendor/)
build:
go build ${TARGETS}
.PHONY: build
generate:
go generate ${PKGS}
.PHONY: generate
fmt:
go fmt ${PKGS}
.PHONY: fmt
check:
go vet ${PKGS}
.PHONY: check
test:
go test -v ${PKGS} -cover -race -p=1
.PHONY: test
cross:
gox -os '!freebsd !netbsd' -arch '!arm' -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags '-X main.Version=${TAG}' ${TARGETS}
.PHONY: cross
pristine: generate fmt
git ls-files --exclude-standard --modified --deleted --others | diff /dev/null -
.PHONY: pristine
release: pristine cross
@ghr -b ${BODY} -t ${GITHUB_TOKEN} -u ${ORG} -replace ${TAG} dist
.PHONY: release
image: cross
docker build -t quay.io/roboll/helmfile:${TAG} .
run: image
docker run --rm -it -t quay.io/roboll/helmfile:${TAG} sh
push: image
docker push quay.io/roboll/helmfile:${TAG}
tools:
go get -u github.com/tcnksm/ghr github.com/mitchellh/gox
.PHONY: tools
TAG = $(shell git describe --tags --abbrev=0 HEAD)
LAST = $(shell git describe --tags --abbrev=0 HEAD^)
BODY = "`git log ${LAST}..HEAD --oneline --decorate` `printf '\n\#\#\# [Build Info](${BUILD_URL})'`"