I have a freeStyleJob that currently sets a few default env variables using the following syntax:
freeStyleJob('myjob') {
environmentVariables {
env('MY_VARIABLE', 'default value')
}
}
I want to add a parameter to this job so that I can override this environment variable with whatever parameter the user enters when they 'build with parameters'
I tried adding a parameter to take input as follows
job('example') {
parameters {
stringParam('myParameterName', 'my default stringParam value', 'my description')
}
}
However, I am not sure how to then feed that value into the environment Variables.