Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Force update a specific puppet environment using r10k with clearing cache
# 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
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