Last active
August 29, 2015 14:06
-
-
Save phpguru/f7236d39dd887be2ab4f to your computer and use it in GitHub Desktop.
Force update a specific puppet environment using r10k with clearing cache
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
#!/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