Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
AutoPkg build that pipes output to a log file. Build fails if nothing is added to munki.
/usr/local/bin/autopkg run -v ${JOB_NAME}.munki MakeCatalogs.munki 2>&1 | tee /Users/Shared/Jenkins/tmp/${JOB_NAME}.log
RESULT=`grep rebuilt /Users/Shared/Jenkins/tmp/${JOB_NAME}.log`
if [ -n "$RESULT" ]; then
echo "${JOB_NAME} added to Munki repository. Build successful."
exit 0
echo "Nothing added to munki. Failing the build even though all is well."
exit 1

This comment has been minimized.

Copy link
Owner Author

derak commented Oct 21, 2014

I am using job names that are identical to my AutoPkg recipe names, this allows me to use the ${JOB_NAME} variable in Jenkins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.