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

Allow post-build batch tasks to be run even after build failure

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • durable-task-plugin
    • None

      In addition to the fix made in JENKINS-2654, I would like to execute a batch task even after a build failure.

      You could argue, that you could simply add a build step for that, but this is not possible in my case. We have a matrix project: while the "wrapper" project is executed on the master, each part of the matrix is executed on a slave. After a build I would like to generate some historical statistics (similar to the existing trend charts on the dashboard, but there's no plugin for that tool, yet). Since only the master has all the history data, I have to execute that task on the master. And I also want to execute that task after every build.

          [JENKINS-7401] Allow post-build batch tasks to be run even after build failure

          David Wheeler added a comment -

          I too would like this. I have a pipeline with:

              post {
                  always {
                      archiveArtifacts 'RPMS/*/*.rpm'
                      sshPublisher(publishers: [sshPublisherDesc(configName: 'yum', transfers: [sshTransfer(remoteDirectory: "third-party", removePrefix: "RPMS/", sourceFiles: "RPMS/*.rpm")])])
                  } 
              }
          

          But it refuses to publish the RPMs after failure. Most of the time that's what I want, but I put it here in always for a reason. In this case, I have a pipeline that builds a lot of third-party RPMs and publishes them to our Yum repo, and I want all the successfully-built RPMs to be published, even if some didn't build. I'd love a flag to disable the logic that prevents the publish from happening when I'm certain that's why I need.

          David Wheeler added a comment - I too would like this. I have a pipeline with: post { always { archiveArtifacts 'RPMS/*/*.rpm' sshPublisher(publishers: [sshPublisherDesc(configName: 'yum' , transfers: [sshTransfer(remoteDirectory: "third-party" , removePrefix: "RPMS/" , sourceFiles: "RPMS/*.rpm" )])]) } } But it refuses to publish the RPMs after failure. Most of the time that's what I want, but I put it here in always for a reason. In this case, I have a pipeline that builds a lot of third-party RPMs and publishes them to our Yum repo, and I want all the successfully-built RPMs to be published, even if some didn't build. I'd love a flag to disable the logic that prevents the publish from happening when I'm certain that's why I need.

            kohsuke Kohsuke Kawaguchi
            aebbert aebbert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: