Forked from mattjbarlow/gist:242b66cdae6938d34419
Last active
April 15, 2016 11:39
-
-
Save biinari/41ddc6eced8f1c42c00a7b0c98b9e868 to your computer and use it in GitHub Desktop.
Chef Shell in Test Kitchen (assuming using chef_solo provisioner)
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 | |
set -e # fail on errors | |
set -x # trace on | |
RUNLIST="$1" # eg 'recipe[example],role[something]' | |
cd /tmp/kitchen | |
[ -f client.pem ] || ssh-keygen -P '' -f client.pem | |
sudo /opt/chef/embedded/bin/gem install chef-zero -v '4.5.0' # last version to not enforce ruby version >= 2.1.0 | |
pgrep chef-zero >/dev/null || /opt/chef/embedded/bin/chef-zero -d | |
knife cookbook upload -a -c solo.rb | |
sudo -E chef-shell -z -c solo.rb -j dna.json -o "${RUNLIST}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment