How to write an advertising work for several upstream projects in Jenkins?

I have quite a few build projects in jenkins (several projects with several branches each), I would like to include them for promotion (using the promotion plugin).

The promotion process will be almost the same for all different tasks. Therefore, I would not want to write all the stages of promotion in each of the assembly projects, but rather, have one advertising work that can promote them.

As I see it, the user will manually select and promote one assembly from any assembly project. assembly initiates a new assembly of advertising work, which extracts information from an advanced assembly and promotes it.

My problem is that I don't seem to see a way to extract artifacts from an advanced build.

If I use the copy artifact plugin, it forces me to select the upstream task, and I seem to be unable to write more than one. The help says that I can use the $ variables, but I donโ€™t see how, since I donโ€™t see the advanced assembly identifier among the environment variables.

I am sure that this can be solved, but I do not understand how to do it.

Does anyone have an idea?

thanks.

+4
source share
1 answer

When the ad campaign is moving forward, two variables appear during the action that refer to the original task. It:

  • PROMOTED_JOB_NAME: name of the source job.
  • PROMOTED_NUMBER: source assembly number of the source job.

You can use them in promotion-related activities to reference the original assignment. I use them with the Copy Artifacts plugin to extract archive files from the original assembly, and then do things like copy to the network, publish, etc.

+2
source

Source: https://habr.com/ru/post/1385508/


All Articles