Skip to content
Permalink
main
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 28 lines (23 sloc) 731 Bytes
#!/bin/sh
set -ex
echo building
# git describe --always --tags --dirty --long)
REVISION=`git rev-parse --short=5 HEAD`
BUILDTIME=`TZ=UTC date "+%Y-%m-%dT%H:%MZ"`
echo $REVISION > REVISION
OS=${GOOS:-`go env GOOS`}
ARCH=${GOARCH:-`go env GOARCH`}
set -ex
go build -o dist/geodns-$OS-$ARCH \
-mod=vendor \
-trimpath \
-ldflags "-X main.gitVersion=$REVISION -X main.buildTime=$BUILDTIME" \
-v && \
(cd geodns-logs && go build -trimpath -mod=vendor -v -o ../dist/geodns-logs-$OS-$ARCH && cd ..) && \
cd dist && \
rm -f service service-logs && \
ln -s ../service . && \
ln -s ../service-logs . && \
tar -cvhf geodns-$OS-$ARCH.tar \
--exclude \*~ geodns-$OS-$ARCH \
geodns-logs-$OS-$ARCH service service-logs