在git子模块中提交后触发Jenkins测试 [英] Trigger Jenkins tests after commits in git submodules
问题描述
我有一个超级项目,它只汇集了多个git sumodules。我希望触发Jenkins以更新子模块以及更新超级项目。
/ superproject
/ submodule -a
/ submodule -b
/ submodule -c
我使用的每个子模块都是作业DSL插件,并且工作正常,除非一些模块需要其他人编译或运行测试 - 这是在一个超级项目中聚合所有其他回购站的原因之一。
我应该如何测试各个子模块以及集成是否是超级项目的一部分?
这根本不符合逻辑。如果 git插件配置为在<$ c $之后触发作业c> post-receive 钩在远程
存储库中,那么它应该可以工作。
一个新的提交被推送到父项目不具备的子模块。你必须这样做:
git submodule update --remote --recursive
git commit
git推
然后,只有这样,作业才会收到通知。欲了解更多信息,你可以阅读:
I have a super project that only aggregates multiple git sumodules. I would like to trigger Jenkins for each change in submodules as well as when super project is updated.
/superproject
/submodule-a
/submodule-b
/submodule-c
For each submodule I am using Job DSL plugin and works fine except when some modules require others to compile or run tests -- that is one reason to aggregate all other repos in one super project.
What should I do for testing individual submodules as well as integration as part of a super project?
I think this does not make sense. If git plugin is configured to trigger a job after post-receive
hook in remote
repository then it should work.
If a new commit is pushed to a submodule the parent project does not noticies. You must have to do:
git submodule update --remote --recursive
git commit
git push
Then, and only then, the job should receive the notification. For more information you could read:
- Polling must die: triggering Jenkins builds from a git hook
- How can I make Jenkins CI with git trigger on pushes to master?
这篇关于在git子模块中提交后触发Jenkins测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!