0
0
mirror of https://github.com/letic/Shell-Scripts.git synced 2024-09-27 21:46:03 +00:00

Update build-go-app.sh

This commit is contained in:
Mark McDonnell 2016-04-26 16:42:50 +01:00
parent 93b136e1d2
commit 2c8e6645c3

View File

@ -1,27 +1,31 @@
if [ $(cat status) -eq 1 ]; then
exit
fi
printf "\nPull Golang Container 1.6.2\n\n" printf "\nPull Golang Container 1.6.2\n\n"
CONTAINER_WS=/gopath/src/github.com/integralsit/go-app/src CONTAINER_WS=/gopath/src/github.com/bbc/mozart-requester/src
docker pull golang:1.6.2 docker pull golang:1.6.2
printf "\nInstall Dependencies\n\n" printf "\nInstall Dependencies and Run Tests\n\n"
docker run --rm=true -v $WORKSPACE/src:$CONTAINER_WS -e "GOPATH=/gopath" -w $CONTAINER_WS golang:1.6.2 \ docker run --rm=true -v $WORKSPACE/src:$CONTAINER_WS -e "GOPATH=/gopath" -w $CONTAINER_WS golang:1.6.2 \
sh -c 'go get github.com/Masterminds/glide && /gopath/bin/glide install' sh -c 'go get github.com/Masterminds/glide && /gopath/bin/glide install && go test $(/gopath/bin/glide novendor)'
printf "\nCompile Application Binary\n\n" printf "\nCompile Application Binary\n\n"
docker run --rm=true -v $WORKSPACE/src:$CONTAINER_WS -e "GOPATH=/gopath" -w $CONTAINER_WS golang:1.6.2 \ docker run --rm=true -v $WORKSPACE/src:$CONTAINER_WS -e "GOPATH=/gopath" -w $CONTAINER_WS golang:1.6.2 \
sh -c 'CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags=\"-s\" -o go-app-binary' sh -c 'CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags=\"-s\" -o mozart-requester'
printf "\nMove Binary to SOURCES\n\n" printf "\nMove Binary to SOURCES\n\n"
mv src/go-app-binary SOURCES mv src/mozart-requester SOURCES
printf "\nPull MBT Container\n\n"
printf "\nPull Custom Build Container\n\n" docker pull registry.news.api.bbci.co.uk/mbt-build
docker pull registry.bbc.co.uk/custom-build
printf "\nBuild RPM\n\n" printf "\nBuild RPM\n\n"
custom-build --os=centos7 -s docker -i registry.bbc.co.uk/custom-build cosmos-build --os=centos7 -s docker -i registry.news.api.bbci.co.uk/mbt-build