Created
June 3, 2014 16:14
-
-
Save fnichol/e950fc67abbda4c8c7e0 to your computer and use it in GitHub Desktop.
ChefDK Installation Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
if [ -d /opt/chefdk ]; then | |
echo "ChefDK installed in /opt/chefdk, quitting" >&2 | |
exit 0 | |
fi | |
url="https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.1.0-1_amd64.deb" | |
pkg="/tmp/`basename \`echo $url\``" | |
echo "--> Downloading ChefDK package from $url" | |
curl -L "$url" > "$pkg" | |
echo "--> Installing $pkg" | |
dpkg -i "$pkg" | |
rm -f "$pkg" | |
echo "--> ChefDK installed into /opt/chefdk" | |
/opt/chefdk/bin/chef --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can improve the script using chef's Omnitruck API so that you can specify the installer download url in a more general way.
For ubuntu 12.04, it's something like:
http://www.chef.io/chef/download?p=ubuntu&pv=12.04&m=x86_64&v=latest&prerelease=false