How to copy artifacts from upstream project in Jenkins?

不羁岁月 提交于 2021-01-27 20:12:01

问题


I have two upstream projects(Pro1, Pro2). Both of the upstream projects archive artifacts. I want to create one downstream projects to copy artifacts from the upstream project who trigger the downstream project.

For example, if the downstream is triggered by Pro1, then it will copy the artifacts from Pro1 not Pro2. In Jenkins, I can configure a project to copy artifacts from other projects but I have to specify the other project name. How can I specify a runtime project name in this case?


回答1:


This is one way of implementation approach for your required scenario,

Pass Upstream Job name to Downstream Job as input parameter.

Use Conditional BuildStep Plugin to check which Job triggered the downstream using the Job name input parameter. By using this add conditional statement to check and copy the artifacts from respective Job.



来源:https://stackoverflow.com/questions/45299288/how-to-copy-artifacts-from-upstream-project-in-jenkins

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