forked from transcend-io/terragrunt-atlantis-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (51 loc) · 1.25 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
VERSION=1.16.0
PATH_BUILD=build/
FILE_COMMAND=terragrunt-atlantis-config
FILE_ARCH=darwin_amd64
S3_BUCKET_NAME=cloudfront-origin-homebrew-tap-transcend-io
PROFILE=transcend-prod
# Determine the arch/os combos we're building for
XC_ARCH=amd64 arm
XC_OS=linux darwin windows
.PHONY: clean
clean:
rm -rf ./build
rm -rf '$(HOME)/bin/$(FILE_COMMAND)'
.PHONY: build
build: clean
CGO_ENABLED=0 \
goxc \
-bc="darwin,amd64" \
-pv=$(VERSION) \
-d=$(PATH_BUILD) \
-build-ldflags "-X main.VERSION=$(VERSION)"
.PHONY: build-all
build-all: clean
CGO_ENABLED=0 \
goxc \
-os="$(XC_OS)" \
-arch="$(XC_ARCH)" \
-pv=$(VERSION) \
-d=$(PATH_BUILD) \
-build-ldflags "-X main.VERSION=$(VERSION)"
.PHONY: gotestsum
gotestsum:
mkdir -p cmd/test_artifacts
gotestsum
rm -rf cmd/test_artifacts
.PHONY: test
test:
mkdir -p cmd/test_artifacts
go test -v ./...
rm -rf cmd/test_artifacts
.PHONY: version
version:
@echo $(VERSION)
.PHONY: sign
sign: build-all
rm -f $(PATH_BUILD)${VERSION}/SHA256SUMS
shasum -a256 $(PATH_BUILD)${VERSION}/* > $(PATH_BUILD)${VERSION}/SHA256SUMS
.PHONY: install
install:
install -d -m 755 '$(HOME)/bin/'
install $(PATH_BUILD)$(FILE_COMMAND)/$(VERSION)/$(FILE_COMMAND)_$(VERSION)_$(FILE_ARCH) '$(HOME)/bin/$(FILE_COMMAND)'