1

I have a jenkins pipeline file where i need to call an sh file

node { 
       stage("Stage1") {
              checkout scm
              sh '''
              echo "Invoking the sh script"
              valueNeedstobepassed = "test"
              '''

       }
       stage ('stage2') {
              Need to refer the "valueNeedstobepassed" varaible in my 
             pipleline step

       }
}

I am not able to refer the variable "valueNeedstobepassed" on stage 2

Any help please?

ASChakkalakal
  • 459
  • 2
  • 8
  • 18
  • Do you want to pass some value, which is calculated in "Stage 1" or do you just need to have the same constant value in both stages? – Michael Sep 15 '18 at 12:55
  • I guess this can answer your question: https://stackoverflow.com/questions/44099851/how-do-i-pass-variables-between-stages-in-a-declarative-jenkins-pipeline – John Sep 17 '18 at 08:20

0 Answers0