using settings files in environment

19 views
Skip to first unread message

Bill C

unread,
Apr 8, 2017, 3:43:44 PM4/8/17
to Jenkins Users

  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




Reply all
Reply to author
Forward
0 new messages