added script to build for drone
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2020-04-07 23:43:41 +02:00
parent 7955eea825
commit 88adfa691e
2 changed files with 13 additions and 5 deletions

View File

@ -10,14 +10,11 @@ platform:
steps:
- name: build
image: golang
commands:
- ./ci-build.sh
environment:
GOOS: linux
GOARCH: amd64
commands:
- mkdir dist
- "go build -o dist/qrz-$DRONE_TAG-$GOOS-$GOARCH -mod=vendor -ldflags='-s -w' cmd/qrz/*.go"
- cd dist
- "tar -czvf qrz-$${DRONE_TAG}-$${GOOS}-$GOARCH.tar.gz"
- name: release
image: plugins/gitea-release
settings:

11
ci-build.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
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
tar -czvf qrz-${DRONE_TAG}-${GOOS}-${GOARCH}.tar.gz
else
echo "Required variables not set"
fi