-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
33 lines (29 loc) · 1.08 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
GOPATH?=$(shell go env GOPATH)
build:
go build -ldflags="-s -w" goctls.go
mv goctls $(GOPATH)/bin/goctls
goctls template clean
goctls template init
$(if $(shell command -v upx), upx goctl)
mac:
@echo ${GOPATH}
GOOS=darwin go build -ldflags="-s -w" -o goctls goctls.go
$(if $(shell command -v upx), upx goctl-darwin)
mv goctls $(GOPATH)/bin/goctls
win:
GOOS=windows go build -ldflags="-s -w" -o goctls.exe goctls.go
$(if $(shell command -v upx), upx goctl.exe)
mv goctls.exe $(GOPATH)/bin/goctls.exe
linux:
GOOS=linux go build -ldflags="-s -w" -o goctls goctls.go
$(if $(shell command -v upx), upx goctl-linux)
mv goctls $(GOPATH)/bin/goctls
image:
docker build --rm --platform linux/amd64 -t kevinwan/goctl:$(version) .
docker tag kevinwan/goctl:$(version) kevinwan/goctl:latest
docker push kevinwan/goctl:$(version)
docker push kevinwan/goctl:latest
docker build --rm --platform linux/arm64 -t kevinwan/goctl:$(version)-arm64 .
docker tag kevinwan/goctl:$(version)-arm64 kevinwan/goctl:latest-arm64
docker push kevinwan/goctl:$(version)-arm64
docker push kevinwan/goctl:latest-arm64