qrz/ci-build.sh

21 lines
423 B
Bash
Raw Normal View History

2020-04-07 23:43:41 +02:00
#!/bin/bash
2020-04-08 00:13:49 +02:00
VERSION=""
if [[ ! -z $DRONE_TAG ]]
2020-04-08 00:14:19 +02:00
then
2020-04-08 00:13:49 +02:00
VERSION=$DRONE_TAG
elif
VERSION=$DRONE_COMMIT
else
2020-04-07 23:47:40 +02:00
2020-04-07 23:43:41 +02:00
if [[ ! -z $DRONE_TAG && ! -z $GOOS && ! -z $GOARCH ]]
then
mkdir dist
go build -o dist/qrz-${DRONE_TAG}-${GOOS}-${GOARCH} -mod=vendor -ldflags='-s -w' cmd/qrz/*.go
cd dist
2020-04-07 23:47:40 +02:00
tar -czvf qrz-${DRONE_TAG}-${GOOS}-${GOARCH}.tar.gz qrz-${DRONE_TAG}-${GOOS}-${GOARCH}
2020-04-07 23:43:41 +02:00
else
echo "Required variables not set"
fi