Skip to content

Instantly share code, notes, and snippets.

@smaftoul
Forked from octplane/changes.sh
Created December 7, 2011 22:35
Show Gist options
  • Save smaftoul/1445047 to your computer and use it in GitHub Desktop.
Save smaftoul/1445047 to your computer and use it in GitHub Desktop.
Quickly upload changes to a chef server (0.8)
#!/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