[英]Jenkins active choices plugin - how to get value of password parameter
[英]Jenkins pass value of Active Choices Parameter
我有一份 jenkins 工作,其中包含“Active Choices Parameter”和“Active Choices Reactive Parameter”。
pipeline {
agent { label 'Agent_Name' }
stages {
stage('Build') {
steps {
script {
def res=build job: 'App_Build', parameters: [string(name: 'ActiveChoicesParam', value: 'Dev'),string(name: 'ActiveChoicesReactiveParam', value: 'Server1')]
}
}
}
}
}
我正在嘗試調用 jenkins 作業並使用管道腳本傳遞參數值。 但是,我收到以下錯誤:
參數“ActiveChoicesParam”沒有 App_Build 預期的類型。 轉換為 Active Choices 參數。
參數“ActiveChoicesReactiveParam”沒有 App_Build 預期的類型。 轉換為主動選擇反應參數。
它們(Dev 和 Server1)是有效值 - 如何傳遞這些值?
嘗試設置為新的 StringParameterValue
build(job: "App_Build",
parameters: [
new StringParameterValue('ActiveChoicesParam', 'Dev'),
new StringParameterValue('ActiveChoicesReactiveParam', 'Server1')
],
)
不知何故new StringParameterValue( 'key', 'value' )
對我不起作用。 我正在使用;
List<ParameterValue> newParams = [
[$class: 'StringParameterValue' , name: 'ActiveChoicesParam' , value: 'Dev' ] ,
[$class: 'StringParameterValue' , name: 'ActiveChoicesReactiveParam', value: 'Server1'] ,
]
def res = build ( job: 'App_Build' ,
propagate : false ,
wait : true ,
parameters: newParams
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.