-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathMakefile
38 lines (30 loc) · 1.65 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
.PHONY: build docker docker-push release install test clean
VERSION := 0.1.10
DOCKER_IMAGE_NAME := jrhouston/tfk8s
build:
go build -ldflags "-X main.toolVersion=${VERSION}"
docker:
docker build -t ${DOCKER_IMAGE_NAME}:${VERSION} .
docker-push: docker
docker push ${DOCKER_IMAGE_NAME}:${VERSION}
release: clean
mkdir -p release/
# FIXME use gox for this
GOOS=linux GOOARCH=386 go build -ldflags "-X main.toolVersion=${VERSION}" -o release/tfk8s_${VERSION}_linux_386
zip -j release/tfk8s_${VERSION}_linux_386.zip release/tfk8s_${VERSION}_linux_386
GOOS=linux GOOARCH=amd64 go build -ldflags "-X main.toolVersion=${VERSION}" -o release/tfk8s_${VERSION}_linux_amd64
zip -j release/tfk8s_${VERSION}_linux_amd64.zip release/tfk8s_${VERSION}_linux_amd64
GOOS=linux GOOARCH=arm go build -ldflags "-X main.toolVersion=${VERSION}" -o release/tfk8s_${VERSION}_linux_arm
zip -j release/tfk8s_${VERSION}_linux_arm.zip release/tfk8s_${VERSION}_linux_arm
GOOS=darwin GOOARCH=amd64 go build -ldflags "-X main.toolVersion=${VERSION}" -o release/tfk8s_${VERSION}_darwin_amd64
zip -j release/tfk8s_${VERSION}_darwin_amd64.zip release/tfk8s_${VERSION}_darwin_amd64
GOOS=windows GOOARCH=amd64 go build -ldflags "-X main.toolVersion=${VERSION}" -o release/tfk8s_${VERSION}_windows_amd64
zip -j release/tfk8s_${VERSION}_windows_amd64.zip release/tfk8s_${VERSION}_windows_amd64
GOOS=windows GOOARCH=386 go build -ldflags "-X main.toolVersion=${VERSION}" -o release/tfk8s_${VERSION}_windows_386
zip -j release/tfk8s_${VERSION}_windows_386.zip release/tfk8s_${VERSION}_windows_386
install:
go install -ldflags "-X main.toolVersion=${VERSION}"
test:
go test -v ./...
clean:
rm -rf release/*