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

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

    Details

    • Type: Bug
    • Status: Resolved
    • 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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: