In a declarative pipeline, is it possible to define a variable for a settings file in the environment section?
Currently many of my stages have for following form
steps {
configFileProvider([configFile(fileId:'M3',variable:'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS ...'
}
}
Since it appears in basically every stage I think it really clutters up the pipeline. I'd like to do something like this
environment {
MAVEN_SETTINGS = configFile('M3')
}
...
steps {
sh 'mvn -s $MAVEN_SETTINGS ...'
}
I've been combing through the docs but have not found anything. Does anyone know if something like this is possible?
Thanks