1

为什么一项工作不能解决 hudson.plugins.git.BranchSpec 中使用的参数,而另一项工作呢?BRANCH_NAME 在某些方面是否特别而 BACKEND_BRANCH 不是?

好工作

      <parameterDefinitions>
    <hudson.model.StringParameterDefinition>
      <name>BRANCH_NAME</name>
      <description>The branch to deploy from.</description>
      <defaultValue>mybranch</defaultValue>
    </hudson.model.StringParameterDefinition>
    <hudson.model.StringParameterDefinition>
  ....
  <branches>
    <hudson.plugins.git.BranchSpec>
      <name>*/${BRANCH_NAME}</name>
    </hudson.plugins.git.BranchSpec>
  </branches>

失败的工作

  <parameterDefinitions>
    ...
    <hudson.model.StringParameterDefinition>
      <name>BACKEND_BRANCH</name>
      <description>Branch for build deployed to environment</description>
    </hudson.model.StringParameterDefinition>
  ...
  <branches>
    <hudson.plugins.git.BranchSpec>
      <name>*/${BACKEND_BRANCH}</name>
    </hudson.plugins.git.BranchSpec>
  </branches>

错误

hudson.plugins.git.GitException: Command
"/usr/bin/git fetch --tags --progress origin 
+refs/heads/${BACKEND_BRANCH}:refs/remotes/origin/${BACKEND_BRANCH} -
-prune" returned 
...
stderr: fatal: Couldn't find remote ref refs/heads/${BACKEND_BRANCH}
4

0 回答 0