Skip to content

Instantly share code, notes, and snippets.

@fnichol
Created June 3, 2014 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnichol/e950fc67abbda4c8c7e0 to your computer and use it in GitHub Desktop.
Save fnichol/e950fc67abbda4c8c7e0 to your computer and use it in GitHub Desktop.
ChefDK Installation Scripts
#!/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
@duanshiqiang
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment