Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need Job-dsl Syntax for the password parameter

I need jobdsl syntax for getting the password parameter in code. I have tried few syntax everything getting failed

eg: password {
       name('TEST_ADMIN_USERNAME')
       defaultValueAsSecret('foo')
       description('User name with the admin privilege')
       trim(false)
   }

enter image description here

like image 594
guhan v Avatar asked Dec 07 '25 02:12

guhan v


1 Answers

Job DSL:

Within a job DSL, you can use nonStoredPasswordParam, to provide a password. The nonStoredPasswordParam parameter is provided by the Mask Passwords plugin, hence need to install the plugin as well. The parameter declaration would look something like the below:

parameters {
    nonStoredPasswordParam('TEST_ADMIN_USERNAME', 'User name with the admin privilege')
}

Declarative Pipeline:

In a declarative pipeline defined within a pipeline {} block, using the password parameter specifying the names of the method arguments explicitly works. Something like below:

parameters {
    password(
        name: 'TEST_ADMIN_USERNAME',
        description: 'User name with the admin privilege'
    )
}
like image 94
devatherock Avatar answered Dec 08 '25 15:12

devatherock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!