adding some build scripts

This commit is contained in:
Craig Peterson 2016-08-25 17:03:32 -06:00
parent ef0bbf53af
commit 37c9864ecd
3 changed files with 29 additions and 0 deletions

3
.gitignore vendored
View file

@ -1 +1,4 @@
/tmp
dnscontrol-Darwin
dnscontrol-Linux
dnscontrol.exe

23
build.sh Executable file
View file

@ -0,0 +1,23 @@
PKG=github.com/StackExchange/dnscontrol
FLAGS="-s -w"
echo 'Building Linux'
go build -o dnscontrol-Linux -ldflags "$FLAGS" $PKG
echo 'Building Windows'
export GOOS=windows
go build -o dnscontrol.exe -ldflags "$FLAGS" $PKG
echo 'Building Darwin'
export GOOS=darwin
go build -o dnscontrol-Darwin -ldflags "$FLAGS" $PKG
ls -lah dnscontrol*
echo 'Compressing executables'
upx dnscontrol.exe
upx dnscontrol-Linux
upx dnscontrol-Darwin
ls -lah dnscontrol*

3
dockerbuild.sh Executable file
View file

@ -0,0 +1,3 @@
# Run build.sh in a docker container that is guaranteed to have all of the appropriate tools we need
PKG=github.com/StackExchange/dnscontrol
docker run -v `pwd`:/go/src/$PKG -w /go/src/github.com/StackExchange/dnscontrol captncraig/golang-build /bin/sh /go/src/github.com/StackExchange/dnscontrol/build.sh