updated qrz
This commit is contained in:
parent
e598fb6c2d
commit
b52f93d7d6
@ -7,7 +7,7 @@ steps:
|
|||||||
- name: build
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
commands:
|
commands:
|
||||||
- ./ci-build.sh
|
- ./ci-build.sh build
|
||||||
environment:
|
environment:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
@ -18,6 +18,7 @@ steps:
|
|||||||
api_key:
|
api_key:
|
||||||
from_secret: gitea_token
|
from_secret: gitea_token
|
||||||
files: dist/*.tar.gz
|
files: dist/*.tar.gz
|
||||||
|
title: $DRONE_TAG
|
||||||
checksum:
|
checksum:
|
||||||
- sha256
|
- sha256
|
||||||
- sha512
|
- sha512
|
||||||
@ -33,7 +34,7 @@ steps:
|
|||||||
- name: build
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
commands:
|
commands:
|
||||||
- ./ci-build.sh
|
- ./ci-build.sh build
|
||||||
environment:
|
environment:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
@ -44,6 +45,7 @@ steps:
|
|||||||
api_key:
|
api_key:
|
||||||
from_secret: gitea_token
|
from_secret: gitea_token
|
||||||
files: dist/*.tar.gz
|
files: dist/*.tar.gz
|
||||||
|
title: $DRONE_TAG
|
||||||
checksum:
|
checksum:
|
||||||
- sha256
|
- sha256
|
||||||
- sha512
|
- sha512
|
||||||
@ -59,7 +61,7 @@ steps:
|
|||||||
- name: build
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
commands:
|
commands:
|
||||||
- ./ci-build.sh
|
- ./ci-build.sh build
|
||||||
environment:
|
environment:
|
||||||
GOOS: netbsd
|
GOOS: netbsd
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
@ -70,6 +72,7 @@ steps:
|
|||||||
api_key:
|
api_key:
|
||||||
from_secret: gitea_token
|
from_secret: gitea_token
|
||||||
files: dist/*.tar.gz
|
files: dist/*.tar.gz
|
||||||
|
title: $DRONE_TAG
|
||||||
checksum:
|
checksum:
|
||||||
- sha256
|
- sha256
|
||||||
- sha512
|
- sha512
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
|
/dist
|
||||||
/qrz
|
/qrz
|
||||||
*.ini
|
*.ini
|
1
Makefile
1
Makefile
@ -3,7 +3,6 @@
|
|||||||
GOCMD=go
|
GOCMD=go
|
||||||
GOBUILDCMD=${GOCMD} build
|
GOBUILDCMD=${GOCMD} build
|
||||||
GOOPTIONS=-mod=vendor -ldflags="-s -w"
|
GOOPTIONS=-mod=vendor -ldflags="-s -w"
|
||||||
PACKRCMD=${GOPATH}/bin/packr2
|
|
||||||
|
|
||||||
RMCMD=rm
|
RMCMD=rm
|
||||||
BINNAME=qrz
|
BINNAME=qrz
|
||||||
|
54
ci-build.sh
54
ci-build.sh
@ -1,20 +1,48 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERSION=""
|
RELEASEDIR=dist
|
||||||
|
RELEASENAME=qrz
|
||||||
|
VERSION="0"
|
||||||
|
|
||||||
if [[ ! -z $DRONE_TAG ]]
|
GOOPTIONS="-mod=vendor -ldflags='-s -w'"
|
||||||
then
|
SRCFILES=cmd/qrz/*.go
|
||||||
|
|
||||||
|
build() {
|
||||||
|
if [[ ! -z $DRONE_TAG ]]
|
||||||
|
then
|
||||||
VERSION=$DRONE_TAG
|
VERSION=$DRONE_TAG
|
||||||
else
|
elif [[ ! -z $DRONE_TAG ]]
|
||||||
|
then
|
||||||
VERSION=$DRONE_COMMIT
|
VERSION=$DRONE_COMMIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]]
|
if [[ ! -d $RELEASEDIR ]]
|
||||||
then
|
then
|
||||||
mkdir dist
|
mkdir dist
|
||||||
go build -o dist/qrz-${VERSION}-${GOOS}-${GOARCH} -mod=vendor -ldflags='-s -w' cmd/qrz/*.go
|
fi
|
||||||
cd dist
|
if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]]
|
||||||
tar -czvf qrz-${VERSION}-${GOOS}-${GOARCH}.tar.gz qrz-${VERSION}-${GOOS}-${GOARCH}
|
then
|
||||||
else
|
RELEASENAME=qrz-${VERSION}-${GOOS}-${GOARCH}
|
||||||
echo "Required variables not set"
|
fi
|
||||||
fi
|
go build -o ${RELEASEDIR}/${RELEASENAME} ${GOOPTIONS} ${SRCFILES}
|
||||||
|
if [[ ! -z $DRONE_TAG ]]
|
||||||
|
then
|
||||||
|
cd ${RELEASEDIR}
|
||||||
|
tar -czvf ${RELEASENAME}.tar.gz ${RELEASENAME}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
clean() {
|
||||||
|
rm -rf $RELEASEDIR
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"build")
|
||||||
|
build
|
||||||
|
;;
|
||||||
|
"clean")
|
||||||
|
clean
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user