如何在下游项目中的事件上触发上游项目的构建Jenkins

zysjyyx4  于 2022-11-01  发布在  Jenkins
关注(0)|答案(1)|浏览(147)

我正在使用jenkins multijob plugin来构建我的项目和部署构建。

Multi Job Project 
  Build Phase  
    Project A
  **Project B**
    Project C
  Deploy Phase
    Project D

每个项目都是用git SCM配置的&当我构建Multijob项目时,它能正确地构建。
我想在项目B的github push event上触发Multijob项目生成。

bpsygsoo

bpsygsoo1#

更新1:

基本上,您需要将Project B存储库作为子模块添加到Project A存储库中。
更多信息:https://git-scm.com/book/en/v2/Git-Tools-Submodules
执行此操作的一个方便命令:git submodule add git://github.com/username/project.git
有关此问题的更多信息,请访问:how to trigger build in jenkins when changes committed to submodule?
还有:How to configure Git post commit hook

主要答案:

基本上,您必须在项目B的github存储库中配置“Webhooks and Services”。

1.本教程可以帮助您:(特别是教程中配置github项目的部分)
https://learning-continuous-deployment.github.io/jenkins/github/2015/04/17/github-jenkins/
1.这个stackoverflow的答案也很有用:
Jenkins-Build when a change is pushed to GitHub option is not working
1.这四个厨房教程涵盖了Jenkins和Github私有回购集成和推送事件触发器。
http://fourkitchens.com/blog/article/trigger-jenkins-builds-pushing-github

相关问题