-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
93 lines (80 loc) · 3.5 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.PHONY: test
build-prepare:
make cleanup
mkdir bin
cleanup:
- rm -r bin
- rm src/ws4sqlite
upd-libraries:
cd src; go get -u
cd src; go mod tidy
build:
make build-prepare
cd src; CGO_ENABLED=0 go build -trimpath
mv src/ws4sqlite bin/
build-nostatic:
make build-prepare
cd src; go build -trimpath
mv src/ws4sqlite bin/
zbuild-all:
make build-prepare
cd src; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-linux-amd64.tar.gz ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-linux-arm.tar.gz ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-linux-arm64.tar.gz ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=linux GOARCH=riscv64 go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-linux-riscv64.tar.gz ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-linux-s390x.tar.gz ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath
cd src; zip -9 ../bin/ws4sqlite-v0.0.0-darwin-amd64.zip ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath
cd src; zip -9 ../bin/ws4sqlite-v0.0.0-darwin-arm64.zip ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath
cd src; zip -9 ../bin/ws4sqlite-v0.0.0-win-amd64.zip ws4sqlite.exe
rm src/ws4sqlite.exe
cd src; CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath
cd src; zip -9 ../bin/ws4sqlite-v0.0.0-win-arm64.zip ws4sqlite.exe
rm src/ws4sqlite.exe
cd src; CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-freebsd-amd64.tar.gz ws4sqlite
rm src/ws4sqlite
cd src; CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -trimpath
cd src; tar czf ../bin/ws4sqlite-v0.0.0-freebsd-arm64.tar.gz ws4sqlite
rm src/ws4sqlite
test:
cd src; go test -v -timeout 6m
docker:
docker buildx build -f Dockerfile --no-cache -t local_ws4sqlite:latest .
docker-multiarch:
docker run --privileged --rm tonistiigi/binfmt --install arm64,arm
docker buildx build -f Dockerfile --no-cache -t germanorizzo/ws4sqlite:v0.0.0-amd64 .
docker buildx build -f Dockerfile --no-cache --platform linux/arm/v7 -t germanorizzo/ws4sqlite:v0.0.0-arm .
docker buildx build -f Dockerfile --no-cache --platform linux/arm64/v8 -t germanorizzo/ws4sqlite:v0.0.0-arm64 .
docker-publish:
make docker-multiarch
docker push germanorizzo/ws4sqlite:v0.0.0-amd64
docker push germanorizzo/ws4sqlite:v0.0.0-arm
docker push germanorizzo/ws4sqlite:v0.0.0-arm64
docker manifest create -a germanorizzo/ws4sqlite:v0.0.0 germanorizzo/ws4sqlite:v0.0.0-amd64 germanorizzo/ws4sqlite:v0.0.0-arm germanorizzo/ws4sqlite:v0.0.0-arm64
docker manifest push germanorizzo/ws4sqlite:v0.0.0
- docker manifest rm germanorizzo/ws4sqlite:latest
docker manifest create germanorizzo/ws4sqlite:latest germanorizzo/ws4sqlite:v0.0.0-amd64 germanorizzo/ws4sqlite:v0.0.0-arm germanorizzo/ws4sqlite:v0.0.0-arm64
docker manifest push germanorizzo/ws4sqlite:latest
docker-devel:
docker buildx build -f Dockerfile --no-cache -t germanorizzo/ws4sqlite:edge .
docker push germanorizzo/ws4sqlite:edge
docker-test-and-zbuild-all:
docker buildx build -f Dockerfile.binaries --target export -t tmp_binaries_build . --output bin
docker-cleanup:
docker builder prune -af
docker image prune -af