Promote Builds in Artifactory - Scripted Pipeline Syntax

JFrog Integrations Documentation

Content Type
Integrations
ft:sourceType
Paligo

To promote a build between repositories in Artifactory, define the promotion parameters in a promotionConfig object and promote that. For example:

    def promotionConfig = [
        // Mandatory parameters
        'targetRepo'         : 'libs-prod-ready-local',

        // Optional parameters

                // The build name and build number to promote. If not specified, the Jenkins job's build name and build number are used
        'buildName'          : buildInfo.name,
        'buildNumber'        : buildInfo.number,
        // Only if this build is associated with a project in Artifactory, set the project key as follows.
        'project': 'my-project-key',
                // 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-staging-local',
                // Indicates whether to promote the build dependencies, in addition to the artifacts. False by default
        'includeDependencies': true,
                // Indicates whether to copy the files. Move is the default
        'copy'               : 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
    ]

    // Promote build
    server.promote promotionConfig