I have a jenkinsfile which is parametrized. Based on the input parameters I want to set certain environment variables. But I m not able to get the syntax right.
parameters {
choice choices: ['insure-base-docker/insure-base', 'insure-ide/insure-sd', 'insure-ide/insure-ansible','insure-ide/ansible-test-vini'], description: 'Auf welche repository sollte die Tag erstellt?', name: 'repository'
choice choices: ['tag', 'branch'], description: 'Tag oder branch erstellen', name: 'git_entity'
string defaultValue: '21.x.x', description: 'Version die als branch oder Tag ersellt werden muss', name: 'version', trim: false
}
environment {
GIT_URL = "${'https://my_repo/scm/'+param.repository+'.git'}"
GIT_BRANCH = "${'Release/'+param.version}"
CHECKOUT_BRANCH = '${${git_entity} == "tag" ? "master" : "develop"}'
}
the env vars are always wrong. How do I set the env vars correctly?
environmentdirective: the object isparamsand notparam.