Pipeline stop/resume gates

71 views
Skip to first unread message

Brian Jones

unread,
May 31, 2016, 2:02:06 PM5/31/16
to Jenkins Users
I want to have a pipeline where segments of the pipeline are only executed upon a human decision, possibly hours or days after the job is started. What is the recommended way to do this using the pipeline plugin?

pipeline: 

Decide to continue case:
build step A - build step B - < human decision, decide to continue> - build step C

Decide not to continue:
build step A - build step B - < human decision, decide to stop> - no further action

Ignore job after AB completed:
build step A - build step B - < no further human action with job > - no further action


Baptiste Mathus

unread,
May 31, 2016, 2:44:06 PM5/31/16
to jenkins...@googlegroups.com
Well, either you didn't give enough info, or seems quite straightforward.
The human interaction is the input step. Make sure to use it outside a node { } to not occupy an agent while waiting for user input.
I don't see the actual difference you mean between your 1st and 3rd case.

--
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/2268a2c6-5a0b-4bf1-a949-0a3204caa80b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Jones

unread,
May 31, 2016, 3:50:41 PM5/31/16
to Jenkins Users, m...@batmat.net
Thanks for the "outside the node" tip. 

Case 1, subsequent job steps are performed where case 3 they are not. So default of running job if no further further human input is given is to just do A,B.

Baptiste Mathus

unread,
May 31, 2016, 3:57:05 PM5/31/16
to jenkins...@googlegroups.com
You can choose whatever suits your need. You are basically gonna catch your calls to steps A & B, and in the catch clause, are going to use some business logic to decide to make it fail, and just continue with a simple if condition.

When you're ready, just write those, and ask for review here if you don't manage to do what you want. It'll be probably easier to help you anyway (and you'll have got a better grasp of it)

Reply all
Reply to author
Forward
0 new messages