I have a requirement as below i will configure 2 different jobs with different parameters. i am using pipeline shared libraries and under vars folder, my deriveJobParams.groovy looks as follows.
def call(Map config = [:]) {
properties([
parameters([
if ( config.stage = 'add' ) {
string(name: 'RELEASE', defaultValue: '123', description: 'OTM release'),
string(name: 'DB_NAME', defaultValue: 'dba123', description: 'DB name')
}
else {
choice(name: 'SKIP_DB_RESET', choices: ['False', 'True'], description: 'Skip DB reset')
}
])
I am calling this groovy from jenkins pipeline as below.
library(@my-first-library) _
deriveJobParams(stage = 'add')
When i run this job i want to see only 2 string parameters in pipeline job. Is it possible to achieve?