找不到任何修改版本。验证此作业的存储库和分支配置

时间:2017-02-24 17:33:51

标签: git jenkins bitbucket jenkins-pipeline

我有一个Jenkins管道脚本。我正在使用the Bitbucket plugin来构建拉取请求。

在其中,我正在做两次结账。一个是工作而另一个不工作。

这个正在运作:

checkout([$class: 'GitSCM', 
          branches: [[name: "origin/${branchName}"]], doGenerateSubmoduleConfigurations: false,
          extensions: [], gitTool: 'jgit', submoduleCfg: [],
          userRemoteConfigs: [[credentialsId: credentials,
                               name: 'origin',
                               url: repository]]])

repositorycredentialsbranchName是变量。

但是,这个不起作用:

checkout([$class: 'GitSCM', 
          branches: [[name: "origin/pr/${pullRequestId}/merge"]], doGenerateSubmoduleConfigurations: false,
          extensions: [], gitTool: 'jgit', submoduleCfg: [],
          userRemoteConfigs: [[credentialsId: credentials,
                               name: 'origin', refspec: '+refs/pull-requests/*:refs/remotes/origin/pr/*',
                               url: repository]]])

repositorycredentialspullRequestId是变量。

错误讯息为Couldn't find any revision to build. Verify the repository and branch configuration for this job

0 个答案:

没有答案