简体   繁体   English

具有CI工作流程和单一功能部署的庞大TYPO3项目

[英]Huge TYPO3 project with CI workflow and single feature deployment

We've a huge TYPO3 project with several developers. 我们有一个由多个开发人员组成的庞大的TYPO3项目。 We trying to setup a CI infrastructure, with GIT, composer and Jenkins. 我们试图通过GIT,作曲家和Jenkins建立CI基础设施。 We have development (vagrant), staging and production environments. 我们拥有开发(无用),过渡和生产环境。 It is quite common that multiple features are on the staging server at the same time. 登台服务器上同时具有多个功能是很常见的。 Because different people are in charge to test these features, the features are usually not applied to production server at the same time. 由于不同的人负责测试这些功能,因此通常不会同时将这些功能应用于生产服务器。 So we set up the following workflow: 因此,我们设置了以下工作流程:

All developers start from the master branch and creates it's own feature branch. 所有开发人员都从master分支开始,并创建它自己的功能分支。 When the feature should go to staging server, the feature branch should be pushed. 当功能应转到登台服务器时,应推送功能分支。 We have a configuration where all feature branches are defined, which should go to staging. 我们有一个配置,其中定义了所有功能分支,应该转到登台。 Mr. Jenkins merges all feature branches before building the project and deploys everything to staging server. Jenkins先生在构建项目之前合并了所有功能分支,并将所有内容部署到登台服务器。 When one feature is successfully tested and should go to production, the feature branch must be merged to master. 成功测试一项功能并投入生产后,必须将功能分支合并到master。 Mr. Jenkins builds the project and everything will be deployed to production. 詹金斯先生(Jenkins)负责构建该项目,并将一切部署到生产中。

So far we are very satisfied with the workflow except of one point: composer.lock file. 到目前为止,我们对工作流程非常满意,除了以下几点:composer.lock文件。

A feature could update or install a package. 功能可以更新或安装软件包。 As soon as two feature branches manipulate the composer.lock file, there is a conflict with the "hash" of the file which cannot be automatically be merged. 一旦两个功能分支操纵了composer.lock文件,就会与该文件的“哈希”发生冲突,该冲突无法自动合并。

In my opinion there is no clean solution. 我认为没有干净的解决方案。 The only solution for me is to exclude composer.lock file from repository and let Mr. Jenkins do a "composer update" which leads to undefined state of all required packages. 对我而言,唯一的解决方案是从存储库中排除composer.lock文件,并让Jenkins先生进行“作曲者更新”,这将导致所有必需软件包的状态不确定。 The cleanest way in my opinion would be to merge the whole development environment to production after all features have been tested, but this cannot be made because of organizational reasons. 我认为最干净的方法是在测试完所有功能之后将整个开发环境合并到生产中,但这由于组织原因而无法实现。

Is this workflow a huge edge case, or is there a best practice solution? 这个工作流程是一个巨大的优势案例,还是有最佳实践解决方案?

Thanks for any help! 谢谢你的帮助!

You really should add the composer.lock file to you git project, because otherwise you will get different versions at jenkins and of course for every developer! 确实应该composer.lock文件添加到您的git项目中,因为否则您将在jenkins上获得不同的版本,当然,对于每个开发人员来说!

I wouldn't merge more than the current feature + master on jenkins and would solve possible merge problems manually 我合并的内容不会超过jenkins上的当前功能+母版,并且可以手动解决可能的合并问题

My suggestions are: 我的建议是:

  • keep the composer.lock on (feature) branches and (version) tags only 仅将composer.lock保留在(功能)分支和(版本)标签上
  • branches are stable and the version context for developing a new feature is locked 分支是稳定的,并且用于开发新功能的版本上下文已锁定
  • remove composer.lock from the main development branch (master) 从主要开发分支(主机)中删除composer.lock
  • master is always bleeding edge and development occurs until feature (or feature set) freeze 母版始终在边缘发展,直到功能(或功能集)冻结为止
  • when merging a feature branch to the development branch you exclude the composer.lock file 将功能分支合并到开发分支时,将composer.lock文件排除在外
    • you could use git merge --no-commit and then edit the merge, unstage composer.lock, then git commit -m "merged <feature-branch>" 您可以使用git merge --no-commit ,然后编辑合并,取消stage composer.lock,然后使用git commit -m "merged <feature-branch>"
  • on feature freeze, branch out (new version tag) and add composer.lock to lock the version context 在功能冻结时,分支出(新版本标签)并添加composer.lock以锁定版本上下文

Boils down to: feature branch (locked)dev-master (unlocked)version tag (locked) . 归结为: feature branch (locked) ⇾dev dev-master (unlocked)version tag (locked)


  • build deployment package from (locked) version tag + distribute (release) 从(锁定)版本标记构建部署程序包+分发(发布)
  • install/upgrade a release package on production OR follow the approach of using composer on production box and install the version tag :( 在生产环境中安装/升级发布包,或遵循在生产环境中使用composer的方法并安装版本标签:(

The cleanest way in my opinion would be to merge the whole development environment to production after all features have been tested... 我认为,最干净的方法是在测试完所有功能之后将整个开发环境合并到生产环境中。

Merging to production :) - err, no, that would be too easy! 合并到生产中:)-错误,那太容易了!

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

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