More Options with the Jenkins Artifactory Plug-in

JFrog Integrations Documentation

Content Type
Integrations
ft:sourceType
Paligo

For pipelines jobs in Jenkins, you also have the option of sending info from Jenkins back to JFrog Pipelines. This info will be received by JFrog Pipelines as output resources of the Jenkins step in JFrog Pipelines. Here's how you add those resources to the Jenkins pipeline script:

jfPipelines (
    outputResources: """[
        {
            "name": "pipelinesBuildInfo",
            "content": {
                "buildName": "${env.JOB_NAME}",
                "buildNumber": "${env.BUILD_NUMBER}"
            }
        }
    ]"""
)

By default, the Jenkins job status and the optional output resources are sent by Jenkins to JFrog Pipelines when the job finishes. You also however have the option of sending the status and output resources before the Jenkins job ends. Here's how you do it:

jfPipelines (
    reportStatus: "SUCCESS"
)

After Jenkins reports the status back to JFrog Pipelines, it does not wait for any response from JFrog Pipelines, and the job continues to the next step immediately.

You also have the option of putting the reportStatus and outputResources together as follows:

jfPipelines (
    reportStatus: "SUCCESS",
    outputResources: """[
        {
            "name": "pipelinesBuildInfo",
            "content": {
                "buildName": "${env.JOB_NAME}",
                "buildNumber": "${env.BUILD_NUMBER}"
            }
        }
    ]"""
)

The supported statuses are SUCCESS, UNSTABLE, FAILURE, NOT_BUILT or ABORTED.

The Jenkins job will report the status to JFrog Pipelines only once. If you don't report the status as part fo the pipelines script as shown above, Jenkins will report it when the job finishes.