Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Multiple Properties in Scripted Jenkinsfile?

I want to supply both choices and a poll trigger. I've tried a number of attempts, but no avail.

Here is one of my attempts:

properties(
        [parameters([choice(choices: 'dev\nprod', description: 'environment to deploy', name: 'DEPLOY_TO')])],
        [pipelineTriggers([pollSCM('H/2 * * * *')])]
)
like image 313
John Giotta Avatar asked May 13 '26 04:05

John Giotta


1 Answers

I figured out the proper formatting of the properties block

properties(
    [
        parameters([choice(choices: 'dev\nprod', description: 'environment to deploy', name: 'DEPLOY_TO')]),
        pipelineTriggers([pollSCM('H/2 * * * *')])
    ]
)

I had the brackets and parens in the wrong places.

like image 149
John Giotta Avatar answered May 17 '26 10:05

John Giotta



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!