Add setup chef repo script

This commit is contained in:
Yun Mao 2013-05-07 22:01:19 -04:00
parent 4aaf63f072
commit 7f1f2c0999
1 changed files with 20 additions and 0 deletions

20
bin/setup_chef_repo.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# setup chef repo
set -o nounset
set -e
HOSTNAME_ARRAY=(${HOSTNAME//-/ }) # split the hostname by "-"
PREFIX=${HOSTNAME_ARRAY[0]} # the first half is prefix
mkdir -p ~/chef-repo
# first, clone the repo
git clone --recursive git://github.com/maoy/inception-chef-repo.git ~/chef-repo
cd ~/chef-repo/environments/
./instantiate.sh ${PREFIX} allinone
cd ~/chef-repo
knife cookbook upload -a
knife environment from file environments/*.json
knife role from file roles/*.json