The 'Promoting Builds in Artifactory' section in this article describes how your Pipeline script can promote builds in Artifactory. In some cases however, you'd like the build promotion to be performed after the build finished. You can configure your Pipeline job to expose some or all the builds it publishes to Artifactory, so that they can be later promoted interactively using a GUI.
When the build finishes, the promotion window will be accessible by clicking on the promotion icon, next to the build run.
Here's how you do this.
First you need to create a 'promotionConfig' instance, the same way it is shown in the 'Promoting Builds in Artifactory' section.
Next, you can use it, to expose a build for interactive promotion as follows:
Artifactory.addInteractivePromotion server: server, promotionConfig: promotionConfig, displayName: "Promote me please"
You can add as many builds as you like, by using the method multiple times. All the builds added will be displayed in the promotion window.
The 'addInteractivePromotion' method expects the following arguments:
"server" is the Artifactory on which the build promotions is done. You can create the server instance as described in the beginning of this article.
"promotionConfig" includes the promotion details. The "Promoting Builds in Artifactory" section describes how to create a promotionConfig instance.
"displayName" is an optional argument. If you add it, the promotion window will display it instead of the build name and number.