Hello there
Maybe this is a very basic question, but am not being able to access a 
global variable
from a shared library from a Jenkinsfile

under vars I defined something like this

globalVars.groovy
class Vars () {

    def CustomMessage = "This is a new deployment"

}

from my Jenkinsfile

library identifier: 'globalVars@master', \
                     retriever: modernSCM([$class: 'GitSCMSource', \
                                credentialsId: 'tfsservice', \
                                remote: 'http://myrepo.com', \
                                traits: [gitBranchDiscovery()]])


pipeline {

stages {
    stage('Do Some Stuff') {
      steps {
        script {

           sh 'echo ${CustomMessage}'

          }
        }
      }
    }

}

But the above returns nothing, what am I doing wrong?
Thanks
Regards

-- 
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/9cea34b1-38b7-41fb-9e1f-fd6af0db38d3n%40googlegroups.com.

Reply via email to