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

Post block lacks access to node when Docker initialization fails

      Maybe this is true of agent any too (did not check), but saw that if you do something like

      pipeline {
        options {
          skipDefaultCheckout()
          // I think I had a timeout here too
        }
        agent {
          docker {
            image 'whatever'
          }
        }
        stages {
          stage('x') {
            steps {
              checkout scm
              sh '...'
            }
          }
        }
        post {
          failure {
            archiveArtifacts artifacts: '...', allowEmptyArchive: true
          }
        }
      }
      

      and the sh step fails, you get an error message complaining that archiveArtifacts must be run inside a node block.

          [JENKINS-42478] Post block lacks access to node when Docker initialization fails

          Jesse Glick created issue -
          Jesse Glick made changes -
          Summary Original: Post block lacks access to node when using Docker agent New: Post block lacks access to node when Docker initialization fails
          James Dumay made changes -
          Epic Link New: JENKINS-45381 [ 183541 ]
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Rank New: Ranked lower
          Jesse Glick made changes -
          Remote Link New: This issue links to "jenkins-x-buildpacks/jenkins-x-classic #2 (Web Link)" [ 22327 ]
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: