* feat(build): introduce buildx * feat(build): excluded compose v3 * feat(build): excluded compose v3 * feat(build): revert back the Docker binary for Windows * * fix liblicense url override Co-authored-by: yi-portainer <yi.chen@portainer.io>
25 lines
693 B
Bash
Executable File
25 lines
693 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
PLATFORM=$1
|
|
ARCH=$2
|
|
|
|
export GOPATH="/tmp/go"
|
|
|
|
binary="portainer"
|
|
|
|
mkdir -p dist
|
|
mkdir -p ${GOPATH}/src/github.com/portainer/portainer
|
|
|
|
cp -R api ${GOPATH}/src/github.com/portainer/portainer/api
|
|
|
|
cd 'api/cmd/portainer'
|
|
|
|
go get -t -d -v ./...
|
|
GOOS=${PLATFORM} GOARCH=${ARCH} CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s -X github.com/portainer/liblicense.LicenseServerBaseURL=https://api.portainer.io'
|
|
|
|
if [ "${PLATFORM}" == 'windows' ]; then
|
|
mv "$BUILD_SOURCESDIRECTORY/api/cmd/portainer/${binary}.exe" "$BUILD_SOURCESDIRECTORY/dist/portainer.exe"
|
|
else
|
|
mv "$BUILD_SOURCESDIRECTORY/api/cmd/portainer/$binary" "$BUILD_SOURCESDIRECTORY/dist/portainer"
|
|
fi
|