|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
|
|
mkdir -p dist
|
|
|
|
@ -17,12 +19,13 @@ go get -t -d -v ./...
|
|
|
|
|
# the build takes 2 seconds
|
|
|
|
|
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \
|
|
|
|
|
--installsuffix cgo \
|
|
|
|
|
--gcflags="-trimpath $(pwd)" \
|
|
|
|
|
--ldflags "-s \
|
|
|
|
|
-X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \
|
|
|
|
|
-X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \
|
|
|
|
|
-X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \
|
|
|
|
|
-X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \
|
|
|
|
|
-X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \
|
|
|
|
|
-X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \
|
|
|
|
|
--X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \
|
|
|
|
|
--X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \
|
|
|
|
|
--X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \
|
|
|
|
|
--X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \
|
|
|
|
|
--X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \
|
|
|
|
|
--X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \
|
|
|
|
|
-o "../dist/portainer" \
|
|
|
|
|
./cmd/portainer/
|
|
|
|
|