Skip to content

Commit

Permalink
Allow building provisionered OmniOS boxes.
Browse files Browse the repository at this point in the history
Make chef.sh more reliable by not shelling so much. Just chmod +x the downloaded script.
  • Loading branch information
Julian C. Dunn committed Dec 20, 2013
2 parents 69c73ff + 6233805 commit 90524ea
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 90524ea

Please sign in to comment.