Page MenuHomePhabricator

patch-integration-slave-ubuntu1404-trusty.sh

Authored By
Krinkle
Apr 3 2015, 11:16 PM
Size
1 KB
Referenced Files
None
Subscribers
None

patch-integration-slave-ubuntu1404-trusty.sh

#!/bin/bash -eu
#
# Revision: 2015-04-04
#
# Additional provisioning for integration slaves running Ubuntu Trusty.
# This assumes "role::ci::slave::labs" is already enabled and applied.
#
err() {
echo $1
exit 1
}
# Assert: Node version
node_version=$(node --version)
if [[ "$node_version" != "v0.10.25" ]]; then
err "Error: Unexpected Node $node_version"
fi
# Patch: Upgrade outdated npm that ships with Ubuntu
npm_version=$(npm --version)
if [[ "$npm_version" != "2.7.6" ]]; then
if [[ "$npm_version" != "1.3.10" ]]; then
err "Error: Unexpected npm $npm_version"
fi
npm_bin=$(which npm)
if [[ "$npm_bin" != "/usr/bin/npm" ]]; then
err "Error: Unexpected npm path: $npm_bin"
fi
test -L "$npm_bin" || err "Error: No symlink at $npm_bin"
npm_full_bin=$(readlink -f "$npm_bin")
test -f "$npm_full_bin" || err "Error: No file at $npm_full_bin"
sudo rm "$npm_bin"
sudo $npm_full_bin install -g npm@2.7.6
npm_version=$(npm --version)
if [[ "$npm_version" != "2.7.6" ]]; then
err "Error: Failed to upgrade npm"
fi
fi
# Patch: Ensure grunt-cli is installed
sudo npm install -g grunt-cli@0.1.13
grunt_version=$(grunt --version)
if [[ "$grunt_version" != "grunt-cli v0.1.13" ]]; then
err "Error: Unexpected Grunt $grunt_version"
fi
echo "Done!"

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
105546
Default Alt Text
patch-integration-slave-ubuntu1404-trusty.sh (1 KB)

Event Timeline