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

Dockerfile build failures do not trigger failure post section

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.19.3, pipeline-model-definition-plugin 0.6

      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.

            abayer Andrew Bayer
            gllewellyn Gavin Llewellyn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: