如何使用 github 拉取請求構建器通過 jenkins job dsl 配置 jenkins pipelineJob?
我努力了:
pipelineJob("Test GHPRB") {
properties {
pipelineTriggers {
triggers {
githubPullRequest {
useGitHubHooks()
orgWhitelist('orgName')
allowMembersOfWhitelistedOrgsAsAdmin()
}
}
}
}
definition { ... }
}
但它失敗并出現錯誤:
沒有方法簽名:javaposse.jobdsl.plugin.structs.DescribableListContext.githubPullRequest() 適用于引數型別:(usIntJobs$_run_closure1$_closure3$_closure5$_closure6$_closure7) 值:[usIntJobs$_run_closure1$_closure3$_closure5$_closure6$ _closure7@72ad1a0f]
作為獎勵,我將如何通過 jenkins job dsl 配置它,如下所示:

uj5u.com熱心網友回復:
正如 NoamHelmer 在評論中所說,
轉到服務器上的 DSL API 查看器 ( https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html ) 并搜索 ghprbTrigger ,這是您的管道作業所需的。
這非常有用。為了完整起見,將發布上面的作業 dsl 配置。
這是在 pipelineJob.properties 下:
ghprbTrigger {
adminlist("myAdmin")
whitelist("")
orgslist('orgName')
cron("")
triggerPhrase(triggerPhraseStatement)
onlyTriggerPhrase(true)
useGitHubHooks(true)
permitAll(false)
autoCloseFailedPullRequests(false)
displayBuildErrorsOnDownstreamBuilds(true)
commentFilePath("")
skipBuildPhrase("")
blackListCommitAuthor("")
allowMembersOfWhitelistedOrgsAsAdmin(true)
msgSuccess("")
msgFailure("")
commitStatusContext("")
gitHubAuthId("")
buildDescTemplate("")
blackListLabels("")
whiteListLabels("")
includedRegions("")
excludedRegions("")
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/415815.html
標籤:
