簡體   English   中英

如何使用 github 拉取請求構建器通過 jenkins 作業 dsl 配置 Jenkins 管道作業?

[英]How to configure a Jenkins pipelineJob via jenkins job dsl with github pull request builder?

如何使用 github 拉取請求構建器通過 jenkins 作業 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 作業 dsl 配置它,如下所示: 在此處輸入圖像描述

正如 NoamHelmer 在評論中所說,

Go to the DSL API viewer on your server ( https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html ) and search for ghprbTrigger thats the one you need for your pipeline job.

這非常有用。 為了完整起見,將發布上面的作業 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("")
                    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM