在Jenkins构建中不更新的git子模块 [英] git submodules not updating in Jenkins build

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

问题描述

我在詹金斯的一个项目中有一个子模块。我已启用高级设置递归更新子模块。当我运行构建时,我看到工作区中有来自子模块的文件。问题是,它似乎是子模块的第一次修订。当我推送更改时(github上托管的回购站)jenkins似乎没有更新子模块以获得正确的更改。有没有人见过这个?

解决方案

看起来我找到了一个解决方案:

build步骤来执行下面的shell命令:

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ git submodule foreach git checkout master $ b $ git submodule foreach git pull


I have a submodule in a project in jenkins. I've enabled the advanced setting to recursively update submodules. 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 (repo hosted on github) jenkins doesn't seem to update the submodule to get the right changes. Has anyone ever seen this?

解决方案

Looks like I found a solution:

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

git submodule foreach git checkout master
git submodule foreach git pull

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

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