I'd like to set a bunch of variables to be used inside JJB-created pipeline-scm job scripts, e.g. details about CI infrastructure.
It's possible to set those variables using parameters:
- job:
name: "some-job"
project-type: pipeline
pipeline-scm:
...
parameters:
- string:
name: NODE
default: "{node}"
NODE can now be used inside a Groovy-Script like this:
node(env.NODE) {
stage('Checkout') {
...
}
stage(..){..}
}
But now NODE is a job parameter which on the one hand can be changed (which I don't want) and it's being shown next to job parameters I want to be visible and changeable.
Is there a way to just define environment variables for a Jenkins job (like folder properties, i.e. not visible on the "Build with properties" page)?
Use the envinject plugin and define the environment variables as properties-content