How can i add an administrative build in jenkins?

笑着哭i 提交于 2019-12-01 12:42:42

Parameterized Trigger Plugin is what you're looking for.

Once you've installed the plugin, refer 2nd snapshot below. Go to Configure page of your project. Search for Build > Add build step > From drop-down menu, select Trigger/call builds on other projects. After that, click on Add Parameters > From drop-down menu, select Current build parameters

Above snapshot is of parent job A where i am defining a string parameter, which will be utilized in its child job B.

Above snapshot is again of parent job A where i am specifying the downstream (child) job B and also enabling Current build parameters, which will ensure that the parameters defined in parent job A are visible to child jobs. Once we are done with these settings, we should be able to see the upstream job link in the child job B as shown below. This will confirm that things are fine till now. :)

Now the only task left is using/calling the variable (defined in parent job A) in child job B. This is shown in the below snapshot:

  • I tested it on Windows so i used %string%.

  • If you're on UNIX/Linux machine, select 'Execute shell' and use ${string}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!