Skip to content

Commit

Permalink
Installer improvements: improved error checking in deploy.sh and inst…
Browse files Browse the repository at this point in the history
…all/shipbuilder.sh.
  • Loading branch information
jaytaylor committed Jan 7, 2014
1 parent c5b5430 commit 6f4fafa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ EOF
sudo service shipbuilder stop
echo 'info: starting service'
sudo service shipbuilder start
exitCode=0
else
echo 'error: build failed, operation aborted'
exitCode=1
fi
sudo rm -f '` + COMPRESSED_PATH + `' '` + DEPLOYER_SCRIPT_PATH + `'
sudo rm -rf /tmp/build`
sudo rm -rf /tmp/build
exit $exitCode`
)

func getLdFlags() string {
Expand Down
2 changes: 2 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ test -z "$(which envdir)" && echo 'fatal: no "envdir" binary found, make sure da
test ! -d './env' && echo 'fatal: missing "env" configuration directory, see "Compilation" in the README' 1>&2 && exit 1

envdir env go run deploy.go $*
# Preserve exit status code.
exit $?
2 changes: 1 addition & 1 deletion install/libfns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ function prepareLoadBalancer() {

function installGo() {
if [ -z "$(which go)" ]; then
echo 'info: installing go 1.1 on the build-server'
echo 'info: installing go v1.1 on the build-server'
curl --location --silent https://launchpad.net/ubuntu/+archive/primary/+files/golang-src_1.1-1_amd64.deb > /tmp/golang-src_1.1-1_amd64.deb
abortIfNonZero $? 'golang-src package download'
curl --location --silent https://launchpad.net/ubuntu/+archive/primary/+files/golang-go_1.1-1_amd64.deb > /tmp/golang-go_1.1-1_amd64.deb
Expand Down
1 change: 1 addition & 0 deletions install/shipbuilder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ elif [ "${action}" = "install" ]; then
mv ../env/SB_SSH_HOST{,.bak}
echo "${sbHost}" > ../env/SB_SSH_HOST
../deploy.sh
abortIfNonZero $? 'ShipBuilder deployment via deploy.sh failed'
mv ../env/SB_SSH_HOST{.bak,}

ssh -o 'BatchMode yes' -o 'StrictHostKeyChecking no' $sbHost "source /tmp/libfns.sh && prepareServerPart2 ${lxcFs}"
Expand Down

0 comments on commit 6f4fafa

Please sign in to comment.