Thursday, 8 December 2016

Adding environment from external/workspace file into the Jenkins pipeline



// Reading workspace inside pipeline script file using 'readProperties or readFile', 

def props = readProperties file: 'tempFiles/env.properties'

// Adding environment into the Jenkins:
props.each { name, val ->
   println "Exporting to Jenkins environment: " + name + "="  + val
   env."$name" = "$val"
}

Total Pageviews

Popular Posts