Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38005

Using archiveArtifacts with a non-matching pattern silently fails the build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins 2.7.3, Pipeline 2.3
    • Similar Issues:

      Description

      If you happen to specify a pattern that doesn't match any files in the workspace, archiveArtifacts will silently fail the build.

      Jenkinsfile

      node {
          sh 'echo "lol"'
          
          archiveArtifacts artifacts: 'lol*.zip'
      }
      

      Console Output

      Started by user admin
      [Pipeline] node
      Still waiting to schedule task
      Waiting for next available executor
      Running on Azure0907122157 in /home/azureuser/workspace/Experiments/bad-artifacts
      [Pipeline] {
      [Pipeline] sh
      [bad-artifacts] Running shell script
      + echo lol
      lol
      [Pipeline] step
      Archiving artifacts
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: FAILURE
      

      archive step

      In contrast, the use of the archive step (e.g. archive 'lol*.zip' in the above Jenkinsfile) will result in a silently successful build.

        Attachments

          Issue Links

            Activity

            rtyler R. Tyler Croy created issue -
            maxzilla Max Wahler made changes -
            Field Original Value New Value
            Priority Minor [ 4 ] Critical [ 2 ]
            jglick Jesse Glick made changes -
            Component/s core [ 15593 ]
            Component/s pipeline [ 21692 ]
            Assignee Jesse Glick [ jglick ]
            Labels pipeline
            Priority Critical [ 2 ] Minor [ 4 ]
            ileitch Ian Leitch made changes -
            Link This issue is duplicated by JENKINS-41249 [ JENKINS-41249 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #2823 (Web Link)" [ 15818 ]
            michaelneale Michael Neale made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-31931 [ JENKINS-31931 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-45200 [ JENKINS-45200 ]
            rtyler R. Tyler Croy made changes -
            Link This issue relates to JENKINS-46180 [ JENKINS-46180 ]
            rtyler R. Tyler Croy made changes -
            Link This issue is duplicated by JENKINS-40538 [ JENKINS-40538 ]
            bitwiseman Liam Newman made changes -
            Link This issue relates to JENKINS-45200 [ JENKINS-45200 ]
            bitwiseman Liam Newman made changes -
            Link This issue is duplicated by JENKINS-45200 [ JENKINS-45200 ]

              People

              Assignee:
              abayer Andrew Bayer
              Reporter:
              rtyler R. Tyler Croy
              Votes:
              9 Vote for this issue
              Watchers:
              22 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: