Let running Jenkins job fail/succeed "from outside"?

52 views
Skip to first unread message

Christian Flamm

unread,
May 8, 2015, 5:13:55 AM5/8/15
to jenkins...@googlegroups.com
Hi,

is there a way to tell a running Jenkins job it has either failed/succeeded from outside? Something like a REST-like access to be able to finish running Jobs either way.

Thanks in advance,
Christian
Message has been deleted
Message has been deleted
Message has been deleted

swastika basu

unread,
May 12, 2015, 2:40:03 PM5/12/15
to jenkins...@googlegroups.com
Jenkins publishes the results in XML/Json format. Check for http://<jenkins-url>:<port>/jenkins/job/<job-name>/api/xml or http://<jenkins-url>:<port>/jenkins/job/<job-name>/api/ json?pretty=true , Search for color, it will change based on your job result.

Daniel Beck

unread,
May 12, 2015, 2:53:27 PM5/12/15
to jenkins...@googlegroups.com
You should be able to use the Jenkins CLI for this (set-build-result command). It's intended to be used from a shell started by the build, so you'll need to recreate that environment (JOB_NAME and BUILD_NUMBER).
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9d46da37-e258-485f-bba2-0f847b40f29d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Christian Flamm

unread,
May 12, 2015, 3:04:24 PM5/12/15
to jenkins...@googlegroups.com

Sounds good! Will try that!

You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/aeUm6LbSxS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9D141E33-7EC8-4F47-ACFB-2FE9A9A96E9C%40beckweb.net.

Christian Flamm

unread,
May 13, 2015, 3:53:10 AM5/13/15
to jenkins...@googlegroups.com, m...@beckweb.net
Doing this by setting shell environment variables doesn't seem to work - what am I doing woring? Thx!

Christian Flamm

unread,
May 13, 2015, 4:01:49 AM5/13/15
to jenkins...@googlegroups.com, m...@beckweb.net
To be a bit more precise: I can now run the command, without any complains about ... that it has to be run from within a build ... but it has no effect. 

Christian Flamm

unread,
May 13, 2015, 4:10:07 AM5/13/15
to jenkins...@googlegroups.com, m...@beckweb.net
I was wrong! I can set the jobs build result from outside. I wrongly thought the job would then immediately be stopped after the result is clear, but it will go on doing everything and just use my set build result afterwards.

Is there a way to make a job immediately stop do what he's doing after setting the builld result?

Thx!

Christian Flamm

unread,
May 22, 2015, 8:56:46 AM5/22/15
to jenkins...@googlegroups.com, m...@beckweb.net
Is there a way to make a job immediately stop do what he's doing after setting the builld result?

Ideas anyone?

Christian Flamm

unread,
Jun 2, 2015, 4:26:14 AM6/2/15
to jenkins...@googlegroups.com
*bump*

James Nord

unread,
Jun 10, 2015, 4:17:43 PM6/10/15
to jenkins...@googlegroups.com
You can do this in workflow if you use input.

Or if you want the build to immediatly stop you can abort it - but that then may not run post build tasks.

On Tuesday, 2 June 2015 09:26:14 UTC+1, Christian Flamm wrote:
*bump*
Reply all
Reply to author
Forward
0 new messages