2019-03-21 01:20:14 +00:00
|
|
|
export GOPATH="/tmp/go"
|
2019-01-30 22:37:16 +00:00
|
|
|
|
|
|
|
binary="portainer"
|
|
|
|
|
|
|
|
mkdir -p dist
|
2019-03-21 01:20:14 +00:00
|
|
|
mkdir -p ${GOPATH}/src/github.com/portainer/portainer
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-03-21 01:20:14 +00:00
|
|
|
cp -R api ${GOPATH}/src/github.com/portainer/portainer/api
|
2019-01-30 22:37:16 +00:00
|
|
|
|
|
|
|
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"
|