forked from vancluever/docker-nomad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (28 loc) · 767 Bytes
/
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
.PHONY: bin image push release clean
TAG=vancluever/nomad
VERSION=0.8.4
GO_VERSION=1.10.2
bin:
rm -rf 0.X/pkg
mkdir -p 0.X/pkg
docker run --rm -v $(shell pwd)/0.X/pkg:/tmp/pkg golang:$(GO_VERSION)-alpine sh -x -c '\
apk add --no-cache alpine-sdk && \
go get -d github.com/hashicorp/nomad && \
cd $$GOPATH/src/github.com/hashicorp/nomad && \
git checkout v$(VERSION) && \
go build --ldflags "all= \
-X github.com/hashicorp/nomad/version.GitCommit=$$(git rev-parse HEAD) \
" -o /tmp/pkg/nomad'
image: bin
docker build \
--tag $(TAG):latest \
--tag $(TAG):$(VERSION) \
--build-arg NOMAD_VERSION=$(VERSION) \
0.X/
push: image
docker push $(TAG):latest
docker push $(TAG):$(VERSION)
release: push
clean:
rm -rf 0.X/pkg
docker rmi -f $(TAG)