简体   繁体   English

github webhook 在多个 jenkins 服务器上触发作业

[英]github webhook to trigger job on multiple jenkins server

My scenario:我的场景:

  • Single github repo单个 github 回购
  • 4 files in the repo仓库中有 4 个文件
  • 4 jenkins server 4 jenkins服务器

Desired outcome:期望的结果:

  • pushing changes in file A, should trigger job in jenkins server A, pushing changes in file B, should trigger job in jenkins server B and so on.推送文件 A 中的更改,应在 jenkins 服务器 A 中触发作业,推送文件 B 中的更改,应触发 jenkins 服务器 B 中的作业,依此类推。

Is there any solution for this?有什么解决办法吗?

Depending where your repository is hosted (github, gitlab, bitbucket) you might be able to use a pipeline within the repository to look for the changed files and trigger a webhook on the correct server accordingly.根据您的存储库的托管位置(github、gitlab、bitbucket),您可能能够使用存储库中的管道来查找更改的文件并相应地在正确的服务器上触发 webhook。

Another approach could be to always trigger a special job on server A which then looks for changed files and triggers the correct job on the right server.另一种方法可能是始终在服务器 A 上触发一个特殊作业,然后查找更改的文件并在正确的服务器上触发正确的作业。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM