Skip to content

Commit

Permalink
Allow building provisionered OmniOS boxes. Make chef.sh more reliable…
Browse files Browse the repository at this point in the history
… by not shelling so much... just chmod +x the downloaded script.
  • Loading branch information
Julian C. Dunn committed Dec 20, 2013
1 parent 2740402 commit 6233805
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packer/omnios-r151008f.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"type": "shell",
"scripts": [
"scripts/omnios/vmtools.sh",
"scripts/common/chef.sh",
"scripts/omnios/postinstall.sh"
],
"execute_command": "{{.Vars}} sh '{{.Path}}'"
"execute_command": "export {{.Vars}} && sh '{{.Path}}'",
"environment_vars": [ "CHEF_VERSION={{user `chef_version`}}" ]
}
],
"post-processors": [
Expand Down
9 changes: 5 additions & 4 deletions packer/scripts/common/chef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,15 @@ do_download() {

if [ x$CHEF_VERSION != x'provisionerless' ]; then
do_download "$chef_installer_url" "$chef_installer"
chmod +x $chef_installer
if [ x$CHEF_VERSION == x'latest' ]; then
sh "$chef_installer"
$chef_installer
elif [ x$CHEF_VERSION == x'prerelease' ]; then
sh "$chef_installer" -p
$chef_installer -p
else
sh "$chef_installer" -v $CHEF_VERSION
$chef_installer -v $CHEF_VERSION
fi
rm -f "$chef_installer"
rm -f $chef_installer
else
echo "Building a box without Chef"
fi

0 comments on commit 6233805

Please sign in to comment.