I want to add env vars per my multi branch pipeline. I don’t want to add them in my code, but like terraform supports in the UI as key value pairs. There is support for credentials but these are secrets – I want to be able to add regular env vars, something like Environment Injector. However, multibranch pipelines doesn’t support this plugin. Does anyone have some good suggestions?
Hello @riviaaaaaaaaa ,
I’m not sure I get it.
You want to add environment variables, but not in your code?
What about adding some to the pipeline?
pipeline {
agent any
environment {
MY_VAR = "my_value"
BUILD_NUMBER = "${env.BRANCH_NAME}-${env.BUILD_ID}"
}
stages {
// Define your stages here
}
}
I’m not so sure I understood your request, but here is an example where I use them.