[英]Jenkins Pipeline check if parameterized build is really parameterized
[英]Jenkins parameterized pipeline fail
例如,如何通過curl參數化觸發器來觸發pipeline / jenkinsfile語法?
我正在開始的管道:
pipeline{
parameters {
string(name: 'mycommitid', defaultValue: 'nocommit', description: 'my parameterized build')
}
properties([
parameters([
string(defaultValue: 'nocommit', description: 'fas', name: 'mycommitid')
])
])
node{...}
}
通過在代碼中設置此選項,僅當我在jenkins的build triggers部分中手動設置它時,才會觸發我的管道。 但目標是在多分支管道和jenkinsfiles中使用它。
我得到的輸出是(這里的哈希是我鍵入的一些隨機數作為示例):
git rev-parse 4364576456fgds467734ss344c^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE
通過提交后,您如何建議我僅構建該單個修訂版?
在groovy管道腳本中定義參數時,應在作業配置中的groovy腳本之前定義它們。
在作業配置中創建參數后,就可以使用語法${env.PARAM}
在groovy中訪問它們。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.