-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (74 loc) · 1.63 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
CGO_ENABLED = 0
DOCKER_INTERACTIVE = $(if $(shell printenv GITHUB_ACTIONS),-t,-it)
GIT_REVISION = $(or $(shell printenv GIT_REVISION), $(shell git describe --match= --always --abbrev=7 --dirty))
VERSION = snapshot
.PHONY: all-docker
all-docker: docker-do-all
.PHONY: all
all:
make build \
&& make test \
&& make lint \
&& make reportcard \
&& make release-snapshot
.dockerimage: Dockerfile
docker build -t mrconfigen-builder .
touch .dockerimage
.PHONY: docker-do-%
docker-do-%: .dockerimage
docker run \
--rm \
${DOCKER_INTERACTIVE} \
-e CGO_ENABLED=0 \
-v ${PWD}:/code \
-w /code \
mrconfigen-builder \
make $*
.PHONY: build
build:
CGO_ENABLED=${CGO_ENABLED} \
go \
build
.PHONY: build-docker
build-docker: docker-do-build
.PHONY: test
test:
go \
test \
-cover \
-v \
github.com/cewood/mrconfigen/...
.PHONY: test-docker
test-docker: docker-do-test
.PHONY: reportcard
reportcard:
goreportcard-cli -v
.PHONY: reportcard-docker
reportcard-docker: docker-do-reportcard
.PHONY: lint
lint:
golangci-lint run --verbose
.PHONY: lint-docker
lint-docker: docker-do-lint
.PHONY: release-snapshot
release-snapshot:
CGO_ENABLED=${CGO_ENABLED} \
GIT_REVISION=${GIT_REVISION} \
VERSION=${VERSION} \
goreleaser \
--snapshot \
--skip-publish \
--rm-dist
.PHONY: release-snapshot-docker
release-snapshot-docker: docker-do-release-snapshot
.PHONY: release
release:
CGO_ENABLED=${CGO_ENABLED} \
GIT_REVISION=${GIT_REVISION} \
GITHUB_TOKEN=${GITHUB_TOKEN} \
VERSION=${VERSION} \
goreleaser \
release \
--rm-dist
.PHONY: release-docker
release-docker: docker-do-release