Skip to content

Instantly share code, notes, and snippets.

@phpguru
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpguru/f7236d39dd887be2ab4f to your computer and use it in GitHub Desktop.
Save phpguru/f7236d39dd887be2ab4f to your computer and use it in GitHub Desktop.
Force update a specific puppet environment using r10k with clearing cache
#!/bin/bash
#
# Update a specific puppet environment, typically a git branch `featurename`
# or one of your deployment environments, typically `development` or `production`
#
# Save the script as r10ku somewhere in your $PATH and chmod +x it
#
# example usage:
#
# > sudo su -
# > r10ku featurename
if [ $# -eq 0 ]; then
echo 'Branch name (environment to build) required'
exit 1
fi
echo "Building $1 ..."
rm -rf /var/cache/r10k/*
rm -rf /etc/puppetlabs/puppet/environments/$1
/opt/puppet/bin/r10k deploy environment $1 -p --verbose
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment