portainer/build/build_binary_devops.sh

16 lines
393 B
Bash
Executable File

export GOPATH="$BUILD_SOURCESDIRECTORY/api"
binary="portainer"
mkdir -p dist
mkdir -p api/src/github.com/portainer/
cp -R api/ api/src/github.com/portainer/portainer/
cd 'api/cmd/portainer'
go get -t -d -v ./...
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s'
mv "$BUILD_SOURCESDIRECTORY/api/cmd/portainer/$binary" "$BUILD_SOURCESDIRECTORY/dist/portainer"