Jenkins deployment of a particular build through code

22 views
Skip to first unread message

Deepu Sundar

unread,
Jul 30, 2017, 2:18:58 PM7/30/17
to Jenkins Users
Hi Team, 

Need your expert advice on the below query, appreciate your help. 

We have a Jenkins CI/CD process in place for deploying AWS lambda functions into cloud and it is fully automated. 

Now we are building a service portal to manage all aspects of the services being deployed. One of the UI of the portal is deployment history page which will list out all the current and past build history (may be similar to jenkins shows the build history) 

From the UI, the user should be able to trigger the build again (like redeploying a previous version = run a previous build with same exact configuration). What is best way to do this?  What are metadata Jenkins may require to run a previous build with same exact configuration?  What Jenkins API we can use for this purpose.   

Thanks! 

regards, 
Deepu

Sam K

unread,
Jul 31, 2017, 5:24:44 PM7/31/17
to Jenkins Users
Hi 

  I'm not saying this is the best way...

  You can add the feature to kick off jobs remotely using a token.  Then you can somehow grab the parameters of the job.  For example, if user clicks on job no. 6, then this URL gives you the parameters.  With wget/curl magic, I'm sure you can get all the parameters. 

  http://<jenkins-url>/job/Job-1/6/parameters/

Then you can use the URL pattern below to kick off another job with the parameters gathered above

  http://<jenkins-url>/job/myjob/buildWithParameters?token=TOKEN&PARAMETER=Value

Deepu Sundar

unread,
Aug 3, 2017, 3:37:14 PM8/3/17
to Jenkins Users
Thank you Sam,  Will take a shot on this and get back. 
Reply all
Reply to author
Forward
0 new messages