Created
January 31, 2014 15:48
-
-
Save nickrw/8734623 to your computer and use it in GitHub Desktop.
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/bash | |
rdom () { local IFS=\> ; read -d \< E C ;} | |
base_ami=$(while rdom; do | |
if [[ $E = description ]]; then | |
if [[ $C =~ ^ami- ]]; then | |
echo $C | |
fi | |
fi | |
done < /var/lib/jenkins/jobs/packer-base/lastSuccessful/build.xml | head -n 1) | |
echo "Upstream AMI is: ${base_ami}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment