Copied artifact not shown in job?

12 views
Skip to first unread message

zil...@gmail.com

unread,
Sep 21, 2020, 6:06:46 PM9/21/20
to Jenkins Users
I have a JobA that copies an artifact produced JobB

JobA

  stage('Get dependency checker failures report') {

    try {

      copyArtifacts projectName: "JobB",

                    filter: 'DependencyCheckerFailuresReport.yml',

                    fingerprintArtifacts: true,

                    selector: specific(depCheckJob.number.toString())

      archiveArtifacts artifacts: "DependencyCheckerFailuresReport.yml",

                       fingerprint: true

    }

    catch(err) {

      foundDepCheckErrors = false

      println "No dependency check failures!"

    }

  }

  if (foundDepCheckErrors) {

    currentBuild.result = 'FAILURE'

  }


and that functionality works fine, that is, I see on the JobA's console

Copied 1 artifact from "JobB" build number 145 [Pipeline] archiveArtifacts Archiving artifacts

However, I don't see the artifact on JobA's page, on the part part that shows "Last successful artifacts" section? If I remove the last if() clause, I do see the artifact. However, I want the if() clause there, that is, if JobA is able to copy this artifact from JobB, I want JobA to fail.

Any ideas?

Thanks,
Chris

zil...@gmail.com

unread,
Sep 21, 2020, 7:15:07 PM9/21/20
to Jenkins Users
I even added the "onlyIfSuccessful" option, to no avail

   archiveArtifacts artifacts: "DependencyCheckerFailuresReport.yml",

                  fingerprint: true,

                  onlyIfSuccessful: false


Reply all
Reply to author
Forward
0 new messages