woodpecker/.drone.sh

16 lines
527 B
Bash
Raw Normal View History

2019-11-12 20:45:55 +00:00
#!/bin/bash
2017-05-08 00:01:04 +00:00
2017-05-08 00:14:53 +00:00
set -e
set -x
2017-05-08 00:01:04 +00:00
2019-11-12 20:45:55 +00:00
VERSION=$DRONE_TAG
if [ -z "$VERSION" ]; then
2019-11-12 20:55:01 +00:00
VERSION=${DRONE_COMMIT_SHA:0:8}
2019-11-12 20:45:55 +00:00
fi
echo "Building $VERSION"
2019-11-12 21:27:24 +00: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