forked from jwilder/docker-squash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
25 lines (19 loc) · 810 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
.SILENT :
.PHONY : docker-squash clean fmt
TAG:=`git describe --abbrev=0 --tags`
LDFLAGS:=-X main.buildVersion=$(TAG)
all: docker-squash
docker-squash:
echo "Building docker-squash"
go install -ldflags "$(LDFLAGS)"
dist-clean:
rm -rf dist
rm -f docker-squash-linux-*.tar.gz
rm -f docker-squash-darwin-*.tar.gz
dist: dist-clean
mkdir -p dist/linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/linux/amd64/docker-squash
mkdir -p dist/darwin/amd64 && GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/darwin/amd64/docker-squash
release: dist
glock sync github.com/jwilder/docker-squash
tar -cvzf docker-squash-linux-amd64-$(TAG).tar.gz -C dist/linux/amd64 docker-squash
tar -cvzf docker-squash-darwin-amd64-$(TAG).tar.gz -C dist/darwin/amd64 docker-squash