Jenkins: Sharing variables in MultiJob

前端 未结 4 1674
暗喜
暗喜 2021-01-18 02:00

I\'m using Jenkins for testing/build purposes, so I created a MultiJob project with this configuration:

  1. Test Job
  2. Build Job
  3. Install Job
  4. <
4条回答
  •  攒了一身酷
    2021-01-18 02:14

    You can pass the parameter BUILD_ID by using Predefined parameters option in the multi-job phase.

    Steps are as follows:

    • Go to configure page, by clicking on Configure link of your multijob
    • Click on Advanced button of the job where you want to pass the parameter;
    • Click on Add Parameters, select Predefined parameters. Then create a parameter name of your own choice and assign the BUILD_ID to it;
    • Create the same parameter by enabling This build is parameterized option in downstream job where you want to receive the defined parameter. Then you can use the same in your script.

提交回复
热议问题