Created
April 19, 2011 15:54
-
-
Save octplane/928575 to your computer and use it in GitHub Desktop.
Quickly upload changes to a chef server (0.8)
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
#!/bin/sh | |
diff -x .gitignore -x .DS_Store -x metadata.json -x "README" -qr cookbooks/ /srv/chef/cookbooks/ | grep -v "Only in | |
/srv/chef/cookbooks/" | sed -e "s/.*cookbooks\/[ :]*//;s/\/.*//;s/:.*//" | sort | uniq | xargs knife cookbook upload | |
for a in `diff -x .gitignore -x metadata.json -x "README" -qr cookbooks/ /srv/chef/cookbooks/ | grep "Only in /srv/ | |
chef/cookbooks/" | sed -e "s/.*cookbooks\/[ :]*//;s/\/.*//;s/:.*//" | sort | uniq`; do | |
echo "y" | knife cookbook delete $a | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Chef 0.8
Run this from an admin node, inside the root of your chef cookbook repository.
Assumes:
Advantages:
Issues: