mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 00:45:19 +00:00
Add new option on Makefile to generate Binaries for specific GOOS/GOARCH passed via parameter. Support multi-arch build. (#1199)
This commit is contained in:
parent
117ddcee88
commit
336dc33cf4
19
Makefile
19
Makefile
@ -206,6 +206,25 @@ binary-bundle: xp-fleet xp-fleetctl
|
||||
cd build/binary-bundle && cp windows/fleetctl.exe . && zip fleetctl.exe.zip fleetctl.exe
|
||||
cd build/binary-bundle && shasum -a 256 fleet.zip fleetctl.exe.zip fleetctl-macos.tar.gz fleetctl-windows.tar.gz fleetctl-linux.tar.gz
|
||||
|
||||
|
||||
.pre-binary-arch:
|
||||
ifndef GOOS
|
||||
@echo "GOOS is Empty. Try use to see valid GOOS/GOARCH platform: go tool dist list. Ex.: make binary-arch GOOS=linux GOARCH=arm64"
|
||||
@exit 1;
|
||||
endif
|
||||
ifndef GOARCH
|
||||
@echo "GOARCH is Empty. Try use to see valid GOOS/GOARCH platform: go tool dist list. Ex.: make binary-arch GOOS=linux GOARCH=arm64"
|
||||
@exit 1;
|
||||
endif
|
||||
|
||||
|
||||
binary-arch: .pre-binary-arch .pre-binary-bundle .pre-fleet
|
||||
mkdir -p build/binary-bundle/${GOARCH}-${GOOS}
|
||||
CGO_ENABLED=0 GOARCH=${GOARCH} GOOS=${GOOS} go build -tags full -o build/binary-bundle/${GOARCH}-${GOOS}/fleet -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
CGO_ENABLED=0 GOARCH=${GOARCH} GOOS=${GOOS} go build -tags full -o build/binary-bundle/${GOARCH}-${GOOS}/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
cd build/binary-bundle/${GOARCH}-${GOOS} && tar -czf fleetctl-${GOARCH}-${GOOS}.tar.gz fleetctl fleet
|
||||
|
||||
|
||||
# Drop, create, and migrate the e2e test database
|
||||
e2e-reset-db:
|
||||
docker-compose exec -T mysql_test bash -c 'echo "drop database if exists e2e; create database e2e;" | mysql -uroot -ptoor'
|
||||
|
Loading…
Reference in New Issue
Block a user