-
Notifications
You must be signed in to change notification settings - Fork 26
/
makefile
54 lines (39 loc) · 1.75 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
VERSION := $(shell grep -Eo '(\d\.\d\.\d)(-dev)?' main.go)
.PHONY: build check test mkrel upload
linux: linux_amd64
linux_amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/vault-backend-migrator-linux-amd64 github.com/adamdecaf/vault-backend-migrator
osx: osx_amd64
osx_amd64:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/vault-backend-migrator-osx-amd64 github.com/adamdecaf/vault-backend-migrator
win: win_64
win_64:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/vault-backend-migrator-amd64.exe github.com/adamdecaf/vault-backend-migrator
dist: build linux osx win
check:
go vet ./...
go fmt ./...
test: check dist
go test -v ./...
ci: check dist test
build: check
go build -o vault-backend-migrator github.com/adamdecaf/vault-backend-migrator
@chmod +x vault-backend-migrator
docker: dist
docker build -t adamdecaf/vault-backend-migrator:$(VERSION) .
dockerpush: docker
docker push adamdecaf/vault-backend-migrator:$(VERSION)
release: ci docker dockerpush mkrel upload
tag:
git tag $(VERSION)
git push --tags origin $(VERSION)
mkrel: tag
ifeq ($(DEV), )
$(shell gothub release -u adamdecaf -r vault-backend-migrator -t $(VERSION) --name $(VERSION) --pre-release)
else
$(shell gothub release -u adamdecaf -r vault-backend-migrator -t $(VERSION) --name $(VERSION))
endif
upload:
gothub upload -u adamdecaf -r vault-backend-migrator -t $(VERSION) --name "vault-backend-migrator-linux" --file bin/vault-backend-migrator-linux-amd64
gothub upload -u adamdecaf -r vault-backend-migrator -t $(VERSION) --name "vault-backend-migrator-osx" --file bin/vault-backend-migrator-osx-amd64
gothub upload -u adamdecaf -r vault-backend-migrator -t $(VERSION) --name "vault-backend-migrator.exe" --file bin/vault-backend-migrator-amd64.exe