0
votes

I'm not able to get the value of the pre-configured container template environment variable in my application pipeline (Manage Jenkins => Jenkins Configuration => Kubernetes Pod Templates => Container Templates => EnvVar).

I'm using the latest version of Jenkins and Kubernetes Jenkins Plugin.

I tried the following and every time I end with null.

node('bunking-gibbon-jenkins-slave') {
    container('apidev-container-build'){
        stage("extraction"){
            echo("Chart Var is '${env.CHARTPATH}'")
        }
    }
}

OR

node('bunking-gibbon-jenkins-slave') {
    container('apidev-container-build'){
        stage("extraction"){
            echo CHARTPATH
        }
    }
}

screenshot for the issue

1
Isn't this supporting just specific agents for declarative pipeline only? - hakamairi

1 Answers

0
votes

from groovy, this should work: ${CHARTPATH}