简体   繁体   English

使用Jenkins和GitHub组织的Chef的代码样式测试

[英]Code Style Testing for Chef using Jenkins and GitHub organizations

Currently, we commit Chef cookbooks to individual repos within our GitHub organization. 目前,我们将厨师食谱提交给我们GitHub组织中的各个仓库。 We are configuring a Jenkins job per repo / cookbook which will execute cookstyle first when a commit occurs, and if cookstyle passes with no issues, it will execute Test Kitchen. 我们正在为每个回购/食谱配置Jenkins作业,该作业将在提交发生时首先执行cookstyle,并且如果cookstyle通过而没有问题,它将执行Test Kitchen。 We have a template Jenkins job we copy and configure for each cookbook we create. 我们有一个模板Jenkins作业,我们为创建的每个食谱复制和配置。

Does anyone know if it's possible to have GitHub hooks in Jenkins to listen for commit events across the entire organization, and then execute cookstyle on a repo where a commit occurred that contain a Chef cookbook? 有谁知道是否可以在Jenkins中使用GitHub挂钩来监听整个组织中的提交事件,然后在发生包含厨师食谱的提交的仓库中执行cookstyle? I'd like to have one central job handling the lint testing for our organization. 我想要一个中心工作来为我们的组织处理棉绒测试。

You wouldn't generally use a single job for this. 通常,您不会使用单个作业。 You would use the GitHub Organization support to scan for all repositories and build them when they change. 您将使用GitHub Organization支持来扫描所有存储库,并在它们更改时构建它们。 You can use webhooks to ping individual repos. 您可以使用webhook来ping单个存储库。

You can create github web hooks for your github organization and configure your jenkins with the help of github plugin. 您可以为github组织创建github Web挂钩,并在github插件的帮助下配置jenkins。 Refer this documentation to see how to configure 请参阅此文档以了解如何配置

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

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