Jenkins Git分支无法使用环境变量 [英] Jenkins Git Branch not working with Environment Variables
问题描述
伙计们,
有一个环境变量配置了作业BRANCH
,但是当我尝试用它配置git scm时,控制台出现错误
Folks,
There is an environment variable a job is configured with, BRANCH
, but when I try configuring git scm with it, i get an error in console
Branch Specifier (blank for 'any')
*/$ {BRANCH}
Branch Specifier (blank for 'any')
*/${BRANCH}
git rev-parse refs/remotes/origin/$ {BRANCH} ^ {commit}#timeout = 10 git rev-parse refs/remotes/origin/origin/$ {BRANCH} ^ {commit}#timeout = 10 git rev-parse origin/$ {BRANCH} ^ {commit}#timeout = 10 错误:找不到要构建的任何修订.
git rev-parse refs/remotes/origin/${BRANCH}^{commit} # timeout=10 git rev-parse refs/remotes/origin/origin/${BRANCH}^{commit} # timeout=10 git rev-parse origin/${BRANCH}^{commit} # timeout=10 ERROR: Couldn't find any revision to build.
我100%确信git很好,分支存在.
I am 100% certain git is fine, branch exists.
推荐答案
将*/${BRANCH}
更改为*/$BRANCH
,这对我有用.
Change */${BRANCH}
to */$BRANCH
, this works for me.
分支说明符("any"为空白) */$BRANCH
这篇关于Jenkins Git分支无法使用环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!