Git 子模块未在 Jenkins 构建中更新 [英] Git submodules not updating in Jenkins build

查看:48
本文介绍了Git 子模块未在 Jenkins 构建中更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Jenkins 的一个项目中有一个子模块.我已启用高级设置以递归更新子模块.

I have a submodule in a project in Jenkins. I've enabled the advanced setting to recursively update submodules.

当我运行构建时,我看到工作区包含来自子模块的文件.问题是,它似乎是子模块的第一次修订.当我推送更改(托管在 GitHub 上的存储库)时,Jenkins 似乎没有更新子模块以获得正确的更改.有没有人见过这个?

When I run the build, I see that the workspace has the files from the submodule. The problem is, it seems to be the first revision of the submodule. When I push changes (repository hosted on GitHub) Jenkins doesn't seem to update the submodule to get the right changes. Has anyone ever seen this?

推荐答案

看来我找到了解决方案:

It looks like I found a solution:

我添加了一个构建步骤来执行以下 shell 命令:

I added a build step to execute the following shell commands:

git submodule foreach git checkout master
git submodule foreach git pull

这篇关于Git 子模块未在 Jenkins 构建中更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆