简体   繁体   English

詹金斯和通知

[英]Jenkins and notifications

I'm just starting to learn Jenkins watching some online videos. 我刚刚开始学习詹金斯观看一些在线视频。 One thing that puzzles me is how does one avoid getting notifications when committing changes that you know will cause the compile to fail. 让我感到困惑的一件事是,在提交您知道会导致编译失败的更改时,如何避免收到通知。

For example, I make a change in a class and commit it. 例如,我在一个类中进行了更改并提交。 Other developers haven't yet got the updated file, so they need to first retrieve the update, change their code and then commit their changes before Jenkins carries out a compile. 其他开发人员尚未获得更新的文件,因此他们需要先检索更新,更改代码,然后提交更改,然后再进行Jenkins的编译。

I'm using Git for code versioning. 我正在使用Git进行代码版本控制。 Am I suppose to use Git separately from Jenkins and make sure the app compiles locally before committing the changes to Jenkins? 我是否应该与Jenkins分开使用Git,并确保在将更改提交给Jenkins之前确保该应用在本地编译?

You can use Jenkins as you want. 您可以根据需要使用Jenkins。 Specially, you don't have to configure Jenkins to run a job on each commit. 特别是,您不必配置Jenkins在每次提交时运行作业。 You can configure it to run some jobs every x hours, etc. 您可以将其配置为每x小时运行一些作业,等等。

If you prefer run a job automatically on commits, but you don't want to break your job if you know a commit will not compile properly, maybe use Git branches to organize your work. 如果您希望在提交时自动运行作业,但是如果您知道提交将无法正确编译,而又不想中断工作,则可以使用Git分支来组织您的工作。 For example, you develeop in a dev branch (or other branches, one for each developer in your team) and when a feature is complete, merge it to the master branch. 例如,您在dev分支(或其他分支,一个团队中的每个开发人员)中进行开发,当功能完成时,将其合并到master分支中。 If Jenkins is configured to run a job on this branch, it will be ok. 如果Jenkins配置为在此分支上运行作业,则可以。

Keep in mind that Jenkins is very flexible. 请记住,詹金斯非常灵活。 When you will understand how it can work, you will probably have ideas for the best configuration for YOUR workflow ;) 当您了解它如何工作时,您可能会想到为您的工作流程提供最佳配置的想法;)

The normal way we since this is too use the Branching of git. 我们自此以来的正常方法也是使用git的Branching。 The master branch should always compile. master分支应始终进行编译。 Only that is auto build. 只是那是自动构建。 If you have a breaking change, you develop it in a feature branch, and later commit that to the master branch 如果有重大更改,请在功能分支中进行开发,然后将其提交给主分支。

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

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