Is this a valid use of environment directive and variables in declarative 
pipeline?

pipeline {
   environment {
       MY_VAR = null
   }  


   stages {
      stage ("...") {
         steps {
         MY_VAR = "this_stage"
         }
      }
      stage ("...") {
         steps {
         MY_VAR = "this_stage2"
         }
      }
  }
  
  post {
      success {
          slackSend (
            message: "$STAGE_NAME stage failed."
         )
      }
  }

}


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6ca3e69a-43ca-4fb5-a2f2-ad03403651c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to