2019-11-12 22:45:55 +02:00
|
|
|
#!/bin/bash
|
2017-05-08 02:01:04 +02:00
|
|
|
|
2017-05-08 02:14:53 +02:00
|
|
|
set -e
|
|
|
|
set -x
|
2017-05-08 02:01:04 +02:00
|
|
|
|
2019-11-12 22:45:55 +02:00
|
|
|
VERSION=$DRONE_TAG
|
|
|
|
|
|
|
|
if [ -z "$VERSION" ]; then
|
2019-11-12 22:55:01 +02:00
|
|
|
VERSION=${DRONE_COMMIT_SHA:0:8}
|
2019-11-12 22:45:55 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Building $VERSION"
|
|
|
|
|
2019-11-12 23:27:24 +02:00
|
|
|
go build -ldflags '-extldflags "-static" -X github.com/laszlocph/woodpecker/version.Version='${VERSION} -o release/drone-server github.com/laszlocph/woodpecker/cmd/drone-server
|
|
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-X github.com/laszlocph/woodpecker/version.Version='${VERSION} -o release/drone-agent github.com/laszlocph/woodpecker/cmd/drone-agent
|