You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Return exit code based on job result if -x switch is on #39
jenkins console -x JOBNAME or jenkins console --exit-code JOBNAME could return a (non)-zero exit code depending on whether the job failed or not.
This will allow people to include the jenkins tool in their workflow and decide differently based on the job status, e.g.
if jenkins console -i -x myjob;thenecho"Hurray"elseecho -e "Subject: Something went wrong \n\n with our job. please help"| sendmail problem@example.com
fi
I know this is already kind-of possible by greeping for SUCCESS or FAIL in the console output, but that's not reliable. Moreover a simple CLI switch looks more elegant and is less prone to typos.
The jenkins info subcommand could use the same switch too.
Activity
LD250 commentedon Jun 13, 2017
@radomirbosak do we need a console output in this case?
Maybe it is better to do this in
startcommand?Something like:
jenkins start job_name --wait-until-doneWhat do you think?
radomirbosak commentedon Aug 24, 2017
Actually yes, your suggestion makes more sense. Let's do it like that.