问题
I have two jobs in Jenkins. First of the name “Build” and the second of the name “Deploy to test environment”. In the first job, tester sets promotion manually, and then only promoted builds can be deployed. In second job I added “Promoted Build Parameter” which generates combobox with promoted builds but I can’t connect the value of this parameter with “Copy artifact from another project” build step. So how can I copy artifacts from the selected promoted build?
回答1:
In your deploy project:
- Configure a Promoted Build Parameter named (for example) PromotedBuild
- Configure Copy artifacts from another project to Specific build with Build number as ${PromotedBuild_NUMBER}
Also, if you want to trigger the deploy project from your build project, you can do this:
- In your promotion process of your build project add Trigger parameterized build on other projects with a Predefined parameter of PromotedBuild_NUMBER=$PROMOTED_NUMBER.
来源:https://stackoverflow.com/questions/21189990/copy-artifacts-from-specific-promoted-build