hudson.plugins.git.BranchSpec中的字符串参数无法解析

时间:2018-03-19 18:02:08

标签: jenkins-pipeline jenkins-github-plugin

为什么一个作业不能解析hudson.plugins.git.BranchSpec中使用的param而另一个作业呢? 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}

0 个答案:

没有答案