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

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

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 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)

      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.

          [JENKINS-15354] Add option to fail the build if specified "Files to deploy" do not exist

          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).

          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).

          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!

          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!

          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

          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

          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.

          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.

          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!

          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
            bduffy Brent Duffy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: