Created
April 26, 2013 02:34
-
-
Save andrewgross/5464750 to your computer and use it in GitHub Desktop.
Sampling of some Chef Glue
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
function download_cookbook() { | |
cookbook=${1} | |
if _check_input ${cookbook} | |
then | |
_clone_cookbook ${cookbook} | |
_link_cookbook_files ${cookbook} | |
cd ${CHEF_PATH}/cookbooks/${cookbook} | |
make install | |
else | |
return 1 | |
fi | |
} | |
function create_cookbook() { | |
cookbook=${1} | |
if _check_input ${cookbook} | |
then | |
_clone_cookbook ${cookbook} clean | |
rm -rf ${CHEF_PATH}/cookbooks/${cookbook}/.git | |
git init ${CHEF_PATH}/cookbooks/${cookbook} | |
_link_cookbook_files ${cookbook} | |
cd ${CHEF_PATH}/cookbooks/${cookbook} | |
make install | |
find . -type f -exec sed -i '' "s/cookbook_base/$cookbook/g" {} \; | |
git add . | |
git commit -m "Initial Commit" --no-verify | |
git remote add origin git@github.com:yipit-cookbooks/${cookbook}.git | |
else | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment