Hi,

As part of our packer script, we install some deb packages into an ubuntu 
instance as well into a chroot environment on that instance. This works 
well, but we recently had a problem with one dependency not installing well 
and us not seeing an error from packer. 

Our packer json looks something like this:

     "sudo pip install awscli",
    "sudo /usr/sbin/chroot --userspec=root:root /linoxide 
add-apt-repository ppa:webupd8team/java -y",
     "sudo /usr/sbin/chroot --userspec=root:root /linoxide apt-get update",
     "sudo /usr/sbin/chroot --userspec=root:root /linoxide apt-get -y 
install oracle-java8-installer",

There was/is an issue with the java package and the last apt-get install 
fails due to a 404 error. Packer continues with generating the amis for the 
other regions.

This is how we call packer build:
packer build -machine-readable -var version=${VERSION} ./packer/xxxx.json | 
tee build.log 
result=$?
if [ ! $result = "0" ]; then
echo "AMI creation failed!"
exit $result
fi

How can bubble up the installation error to jenkins to trigger a build fail?

Many thanks,

Robert

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/fcea53c0-2487-4325-908c-dcdef1459980%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to