Git Rev -list -n 1构建/22.05.3128 20:28:33致命:模棱两可的参数' build/22.05.3128':::
我有一个带有多重概念的詹金斯管道。最近,我们从Gitlab迁移到Github。 现在,使用现有部署的软件包创建一个新分支时,我们正在为某些项目遇到此错误。
[prime_application]运行外壳脚本 20:28:33 + git rev -list -n 1构建/22.05.3128 20:28:33致命:模棱两可的论点“构建/22.05.3128':未知的修订或不在工作树中的路径。 20:28:33使用' - '将路径与修订区分开:这样: 20:28:33'git [...] - [...]'
代码上述步骤:
ansiColor('gnome-terminal') {
timestamps {
ansiColor('gnome-terminal') {
COMMIT_ID_1 = sh(
script: "git rev-list -n 1 \"build/${BUILD_PKG_VER}\"",
returnStdout: true
).trim()
这对某些存储库工作,但主要是所有存储库的失败。
I have a jenkins pipeline with multibranching concept. Recently we have migrated from GITLAB to GITHUB.
While creating an new branch with the existing deployed package now we are getting this error for some of the project.
[Prime_Application] Running shell script
20:28:33 + git rev-list -n 1 build/22.05.3128
20:28:33 fatal: ambiguous argument 'build/22.05.3128': unknown revision or path not in the working tree.
20:28:33 Use '--' to separate paths from revisions, like this:
20:28:33 'git [...] -- [...]'
Code for the Above step:
ansiColor('gnome-terminal') {
timestamps {
ansiColor('gnome-terminal') {
COMMIT_ID_1 = sh(
script: "git rev-list -n 1 \"build/${BUILD_PKG_VER}\"",
returnStdout: true
).trim()
This is working for some of the repos but majorly Its failing for all repos.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该脚本没有获得构建/$ {build_pkg_ver}的值。因为在我的代码中没有标记。确保您可以正确标记构建并再次推动活动。
The script is not getting the value of build/${BUILD_PKG_VER}. Because in my code it was not tagged. Make sure you have correctly tagging your build and again pushing the event.