Page MenuHomePhabricator

patch-integration-slave-trusty.sh

Authored By
Krinkle
Apr 9 2015, 9:18 AM
Size
1 KB
Referenced Files
None
Subscribers
None

patch-integration-slave-trusty.sh

#!/bin/bash -eu
#
# Revision: 2015-04-09
#
# 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
# Patch: Install Zuul
if ! which zuul; then
sudo dpkg -i /home/hashar/zuul_2.0.0-304-g685ca22-wmf1trusty1_amd64.deb || echo "Known failure"
sudo apt-get install -f
fi
echo "Done!"

File Metadata

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

Event Timeline