[英]Jenkins 'Honor refspec on initial clone'; parameterized refspec?
I have a Jenkins job that uses the Git plugin to clone a repository. 我有一个使用Git插件克隆存储库的Jenkins作业。 I have configured it to take refspec configuration from a parameter in Repositories --> Advanced (want to use the same job for multiple refspecs).
我已将其配置为从存储库->高级中的一个参数中获取refspec配置(想要对多个refspec使用相同的作业)。
This works well, until I select the "Honor refspec on initial clone" option in Advanced clone behaviors: 这很好,直到我在“高级克隆行为”中选择“初始克隆的荣誉参考”选项为止:
> git fetch --progress git@REDACTED ${REFSPEC}
> git config remote.origin.url git@REDACTED # timeout=10
> git config --add remote.origin.fetch ${REFSPEC} # timeout=10
> git config remote.origin.url git@REDACTED # timeout=10
Fetching upstream changes from git@REDACTED
using GIT_SSH to set credentials
> git fetch --progress git@REDACTED +refs/heads/*:refs/remotes/origin/*
this is correct ^^^^
As you can see, the initial fetch does not resolve the parameter $REFSPEC, though the second fetch does so correctly. 如您所见,尽管第二次提取可以正确解析,但初始提取不会解析$ REFSPEC参数。
Am I doing smoething wrong, or is this a bug? 我是在打滑吗?这是一个错误吗? Our clone times are through the roof and we need every optimization we can get.
我们的克隆时间很长,我们需要获得所有可能的优化。 I can just add all possible refspecs to the config (this is supported), but that increases the clone time by significantly.
我可以将所有可能的refspec添加到配置中(受支持),但这会使克隆时间大大增加。
That is a bug. 那是一个错误。 Since the refspec parameter is expanded when used without the "Honor refspec on initial clone", it should be honored as well when used with "Honor refspec on initial clone".
由于refspec参数在不带“初始克隆的荣誉refspec”的情况下使用时会扩展,因此在与“初始克隆的荣誉refspec”一起使用时也应遵守。
Submit a git-plugin bug to track the problem. 提交git-plugin错误以跟踪问题。 Refer to JENKINS-49758 for a related bug.
有关相关的错误,请参阅JENKINS-49758 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.