deploy/stratos-ui-release/packages/backend/pre_packaging
# abort script on any command that exits with a non zero value
set -ex
export GOPATH=${PWD}/go
mkdir -p $GOPATH/bin
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
cd ${BUILD_DIR}/stratos
# Install dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# Build backend
npm install
export PATH=$PATH:$PWD/node_modules/.bin
npm run build-backend
find ../stratos/deploy -type d ! -path '../stratos/deploy' ! -path '*/db' -maxdepth 1 | xargs rm -rf
find ../stratos -type d ! -path '*/outputs*' ! -path '*/deploy' ! -path '../stratos' -maxdepth 1 | xargs rm -rf
# Delete top level files
rm -f *.*
mv outputs/* .
rm -rf outputs
# The following packages are required for the post-deploy task
go get bitbucket.org/liamstask/goose/cmd/goose
go get bitbucket.org/liamstask/goose/lib/goose
go get github.com/go-sql-driver/mysql