The Promoting Builds in Artifactory section 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. To enable interactive promotion for a published build, add the rtAddInteractivePromotion as shown below.
rtAddInteractivePromotion ( // Mandatory parameters // Artifactory server ID from Jenkins configuration, or from configuration in the pipeline script serverId: 'Artifactory-1', buildName: 'MK', buildNumber: '48', // Only if this build is associated with a project in Artifactory, set the project key as follows. project: 'my-project-key', // Optional parameters If set, the promotion window will display this label instead of the build name and number. displayName: 'Promote me please', // Name of target repository in Artifactory targetRepo: 'libs-release-local // Comment and Status to be displayed in the Build History tab in Artifactory comment: 'this is the promotion comment', status: 'Released', // Specifies the source repository for build artifacts. sourceRepo: 'libs-snapshot-local', // Indicates whether to promote the build dependencies, in addition to the artifacts. False by default. includeDependencies: true, // Indicates whether to fail the promotion process in case of failing to move or copy one of the files. False by default failFast: true, // Indicates whether to copy the files. Move is the default. copy: true )
You can add multiple rtAddInteractivePromotionclosures, to include multiple builds in the promotion window.