Submit work after manual approval in jenkins

I have a requirement to launch Job B after successfully completing task A. After successful completion of task A, an email notification will be sent to the appropriate administrator. An email will be sent to the approver and click on the link by mail. He will be redirected to Jenkins page, where he will approve the performance of task B.

I'm not sure which plug-in to use, where I can mention the name of the approver, how the approver can click on the link and just say "approve" after entering the Jenkins page.

+9
jenkins jenkins-workflow
source share
2 answers
  • Job A Setting Job A
  • Set up Job A to send an email to your “Approval” as part of the post-build email action.
  • Set up your email so that it contains a link to start the task (and not just the name of the task, or you could even link directly to the promotion by email).
  • Set Up Promotion on Job A
  • In this promotion, allow it to run only by your approving user (by name)
  • Configure this ad to run Job B

When Job A running, it will send an email to the address "approver". He / she will click on the link and enter the Jenkins launch user interface. He / she must log in to Jenkins with the help of his “Approver”.

Then he / she can click on the advertising star and just click "approve" on it. This initiates a promotion, which in turn triggers Job B

Note: you can achieve something similar without the "Promotions" plugin, but this is exactly the reason this plugin exists, so use it.

+11
source share

Another option is to use the Jenkins Workflow plugin (according to the jenkins-workflow tag for the question), which is designed for this kind of more complex system. You will write something like (from the top of your head):

build job: 'A', wait: true mail to: ' user@ …', subject: "Please approve #${env.BUILD_NUMBER}", body: """ See ${env.BUILD_URL}input/ """ input submitter: 'userId', message: 'Ready?' build job: 'B', wait: true

Later, the build steps can be replaced with actual build tasks by putting these freestyle tasks into action.

+4
source share

All Articles