1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/bin/sh -e
git_url="https://github.com/stackforge/cloud-init"
pkgs="git python-tox"
if [ "$1" = "root-setup" ]; then
if ! command -v python2.6; then
add-apt-repository --yes ppa:fkrull/deadsnakes
apt-get update --quiet --assume-yes
pkgs="$pkgs python2.6"
apt-get install --quiet --assume-yes python2.6
fi
apt-get install --quiet --assume-yes $pkgs
exit
fi
sudo "$0" root-setup
if [ -d cloud-init/.git ]; then
( cd cloud-init && git pull )
else
git clone "${git_url}" cloud-init
fi
cd cloud-init
tox
|