How to pass file to downstream job which blocks upstream job?

后端 未结 1 1396
太阳男子
太阳男子 2021-01-13 18:39

What I want to accomplish is to checkout code from develop branch, merge it to master branch, build app.war, run tests and if tests su

相关标签:
1条回答
  • 2021-01-13 18:53

    1. Copying artifacts

    You can put a wrapper job around it and have the Build job and the Test job called as build step by using Trigger/call builds on other projects. Since the build is encapsuled in its own job now, you can archive its artifacts and copy them over to the Test job.

    2. Share workspace

    Another way would be to just share a workspace between build and test.

    3. Pass file as parameter

    A neat way to pass a file to a downstream job is, to pass it as parameter with the help of the Parameterized Trigger Plugin.

    You push a file into your downstream job's workspace simply by selecting the parameter factory For every matching file, invoke one build in a build step Trigger/call builds on other projects. There you specify the target file (wildcards allowed) and the name it should get in the child workspace.

    Note: Your downstream job does not need to have the option This build is parameterized set, the file will be copied either way. Edit: This might not work anymore, see comments.

    0 讨论(0)
提交回复
热议问题