Hello,
I'm waiting for your feedback before opening a bug

for information I have seen this SO post : 
https://stackoverflow.com/questions/45372798/jenkins-kubernetes-plugin-not-passing-environment-variables-with-pipeline
 
and some others but I can't figure out why it is not working 

My jenkins configuration (admin): 
EnvVars
Evironment variable : 
key : MAVEN_OPTS
Value : -Djavax.net.ssl.trustStore=/etc/ssl/certs/cacerts

my jenkinsfile :

def label = "pod-${UUID.randomUUID().toString()}"
pipeline {
agent {
kubernetes {
label "${label }"
yaml """
spec:
containers:
- name: maven
image: maven:3-jdk-8
command:
- cat
tty: true
"""
}
}
stages {
stage('Run maven') {
steps {
sh 'set'
//1
sh 'echo MAVEN_OPTS = ${MAVEN_OPTS}'
container('maven') {
// 2 
sh 'echo MAVEN_OPTS = ${MAVEN_OPTS}'
script {
configFileProvider([configFile(fileId: 'maven_artifactory', variable: 
'MAVEN_SETTINGS')]) {
// 3
sh 'echo MAVEN_OPTS = ${MAVEN_OPTS}'
            }
}
}
}
}
}
}


Everything is OK in the YAML when i check on my kubernetes cluster

but at execution echo MAVEN_OPTS works only in the first case

Thank you in advance

Tristan FAURE


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b0469a40-1557-4766-b348-033a669ddfe3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to