Created
August 21, 2013 18:12
-
-
Save cjerdonek/6297953 to your computer and use it in GitHub Desktop.
A script to back up environments from chef server to your git repo.
This file contains hidden or 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
# Back up environments from chef server to a git repo. | |
# Run this from the top of your chef repo. | |
envs=`knife environment list` | |
for env in $envs | |
do | |
path="environments/${env}.json" | |
knife environment show $env -F json > $path | |
git add $path | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment