-
Bug
-
Resolution: Fixed
-
Major
-
None
The environment declarative no longer works in pipeline.
pipeline { agent { kubernetes { label 'maven-pod' containerTemplate { name 'maven-container' image 'maven' workingDir '/home/jenkins' ttyEnabled true command 'cat' } } } environment { test = 'Hello World!' } stages { stage('print') { steps { //will not print sh 'echo ${test}' container('maven-container'){ //will also not print sh 'echo ${test}' } } } } }
It appears to be due to environment variables for the container being set prior to container execution.
- is related to
-
JENKINS-40647 With Env not working after .10 k8 plugin update
- Resolved
-
JENKINS-46670 Wrong escaping of environment variables in container Step
- Resolved