如何在脚本化的 Jenkinsfile 中使用多个属性?

Joh*_*tta 3 jenkins jenkins-pipeline

我想同时提供选择和投票触发器。我已经尝试了很多次尝试,但都无济于事。

这是我的尝试之一:

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

Joh*_*tta 6

我想出了properties块的正确格式

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

我在错误的地方有括号和括号。