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

Add option to fail the build if specified "Files to deploy" do not exist

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins LTS 1.466.1 on RHEL 6.1 x86_64

      java version "1.6.0_24"
      OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64)
      OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
    • Similar Issues:

      Description

      It'd be nice to have a checkbox option for the [ArtifactDeployer] plugin to cause the build to fail if the artifacts specified in the "Files to deploy" field do not exist. The current behavior of the plugin is to succeed even if there are zero artifacts matching the specified file/wildcard expression.

        Attachments

          Activity

          bduffy Brent Duffy created issue -
          gbois Gregory Boissinot made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          gbois Gregory Boissinot added a comment -

          Like ArtifactDeployer enables you to specify several sections of 'Files to deploy', do you want an option for each section or a global option?
          In first use-case, build fails only if there are no maching files and the option (checkbox) is selected.
          In the second use-case, the build fails only if the option is selected and there is at least one section that doesn't meet the conditions (no matching files).

          Show
          gbois Gregory Boissinot added a comment - Like ArtifactDeployer enables you to specify several sections of 'Files to deploy', do you want an option for each section or a global option? In first use-case, build fails only if there are no maching files and the option (checkbox) is selected. In the second use-case, the build fails only if the option is selected and there is at least one section that doesn't meet the conditions (no matching files).
          Hide
          bduffy Brent Duffy added a comment -

          Hi Gregory,

          I'm thinking if the 'Files to deploy' expression does not match any files relative to the $WORKSPACE, the option, if selected, should trigger a build failure. For example, the following expression could trigger a build failure if no .jar files were present under the 'output' directory:

          output/*.jar

          This new option, 'Fail build if there are no files to deploy' could be added within the 'Advanced...' button options for the 'Files to deploy' field. The problem we're having is that if there are zero files to deploy, the ArtifactDeployer plugin currently indicates that zero artifacts being deployed is a success condition. I'd be useful to have an option to say that, if no artifacts were found to deploy, some error prevented the artifacts from being available for deployment when they were expected per the build configuration.

          Thanks for your quick response!

          Show
          bduffy Brent Duffy added a comment - Hi Gregory, I'm thinking if the 'Files to deploy' expression does not match any files relative to the $WORKSPACE, the option, if selected, should trigger a build failure. For example, the following expression could trigger a build failure if no .jar files were present under the 'output' directory: output/*.jar This new option, 'Fail build if there are no files to deploy' could be added within the 'Advanced...' button options for the 'Files to deploy' field. The problem we're having is that if there are zero files to deploy, the ArtifactDeployer plugin currently indicates that zero artifacts being deployed is a success condition. I'd be useful to have an option to say that, if no artifacts were found to deploy, some error prevented the artifacts from being available for deployment when they were expected per the build configuration. Thanks for your quick response!
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/artifactdeployer/ArtifactDeployerEntry.java
          src/main/java/org/jenkinsci/plugins/artifactdeployer/ArtifactDeployerPublisher.java
          src/main/resources/org/jenkinsci/plugins/artifactdeployer/ArtifactDeployerPublisher/config.jelly
          http://jenkins-ci.org/commit/artifactdeployer-plugin/57ce72ea06f25eb1ca867681a163ac4682d33aeb
          Log:
          Fix JENKINS-15354

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/artifactdeployer/ArtifactDeployerEntry.java src/main/java/org/jenkinsci/plugins/artifactdeployer/ArtifactDeployerPublisher.java src/main/resources/org/jenkinsci/plugins/artifactdeployer/ArtifactDeployerPublisher/config.jelly http://jenkins-ci.org/commit/artifactdeployer-plugin/57ce72ea06f25eb1ca867681a163ac4682d33aeb Log: Fix JENKINS-15354
          Hide
          gbois Gregory Boissinot added a comment -

          Hi,
          I implemented the feature.
          Could you try the new snapshot version (hpi file) here:
          https://buildhive.cloudbees.com/job/jenkinsci/job/artifactdeployer-plugin/ws/target/

          Please let me know if it suit you.

          Show
          gbois Gregory Boissinot added a comment - Hi, I implemented the feature. Could you try the new snapshot version (hpi file) here: https://buildhive.cloudbees.com/job/jenkinsci/job/artifactdeployer-plugin/ws/target/ Please let me know if it suit you.
          Hide
          bduffy Brent Duffy added a comment -

          Hi Gregory,

          I tested the updated plugin, artifactdeployer-0.24-SNAPSHOT.hpi, and it looks like it works perfectly!

          Thanks so much for adding this feature!

          Show
          bduffy Brent Duffy added a comment - Hi Gregory, I tested the updated plugin, artifactdeployer-0.24-SNAPSHOT.hpi, and it looks like it works perfectly! Thanks so much for adding this feature!
          gbois Gregory Boissinot made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 146077 ] JNJira + In-Review [ 191774 ]

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              bduffy Brent Duffy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: