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

Dockerfile build failures do not trigger failure post section

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 2.19.3, pipeline-model-definition-plugin 0.6
    • Similar Issues:

      Description

      I am using the new Dockerfile support added in JENKINS-39216. I also have a "post" section within "pipeline" in my Jenkinsfile set up to send notifications of the build result:

      pipeline {
        // Build environment is defined by the Dockerfile
        agent dockerfile:true
        stages {
          stage('package') {
            steps {
              // Do build
            }
          }
        }
        post {
          success {
            hipchatSend color: "GREEN", message: "SUCCESS: <a href=\"${currentBuild.absoluteUrl}\">${currentBuild.fullDisplayName}</a>"
          }
          failure {
            hipchatSend color: "RED", message: "FAILURE: <a href=\"${currentBuild.absoluteUrl}\">${currentBuild.fullDisplayName}</a>", notify: true
          }
          unstable {
            hipchatSend color: "YELLOW", message: "UNSTABLE: <a href=\"${currentBuild.absoluteUrl}\">${currentBuild.fullDisplayName}</a>", notify: true
          }
        }
      }
      

      However, if a failure occurs during the Dockerfile image build (e.g. a non-zero return code from a RUN step), the build is marked as failed but no notification is sent.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                gllewellyn Gavin Llewellyn
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: