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

Plugin in post step doesn't see injected environment

XMLWordPrintable

      Below code of pipeline where printenv show all envs however plugins see just a few of them and doesn't see required:

      pipeline {
      
        agent any
      
        options {
          skipDefaultCheckout()
        }
        
        environment {
          DOCKER_REPO  = 'mobilityhouse'
          CHANGE_URL = "https://@github.com/mobilityhouse/testci.git"
        }
      
        stages{
          stage('Coverage & Tests') {
            steps {
              sh 'printenv'
              script {
                currentBuild.result = 'SUCCESS'
                env.CHANGE_URL = "https://@github.com/mobilityhouse/testci.git"
              }
            }
          }
        }
      
          post {
              success {
                      sh 'ls && printenv'
                      step([$class: 'MasterCoverageAction'])
              }
          }
      
      }
      

       

            terma Artem Stasiuk
            terma Artem Stasiuk
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: