目前,我正在尝试通过git子模块管理我所有的食谱,我只想确保我的组织方式不会有任何未来的问题。
我考虑到,从可管理性的角度来看,将所有的repo放在一个篮子(一个chef-repo)中并不流行,但我也不想告诉我的开发人员,在测试代码时执行chef run之前,他们必须单独管理和拉取/克隆每个repo(我们也使用berks和chef server )。
因此,下面的git子模块策略是我的解决方案:
chef-repo < main >
├── chef-repo/LICENSE
├── chef-repo/README.md
├── chef-repo/chefignore
├── chef-repo/cookbooks
│ ├── chef-repo/cookbooks/README.md
│ ├── chef-repo/cookbooks/active-directory < submodule >
│ │ ├── chef-repo/cookbooks/active-directory/Berksfile
│ │ ├── chef-repo/cookbooks/active-directory/attributes
│ │ │ └── chef-repo/cookbooks/active-directory/attributes/default.rb
│ │ │ ├── chef-repo/cookbooks/active-directory/libraries/cmd_helper.rb
│ │ ├── chef-repo/cookbooks/active-directory/recipes
│ │ └── chef-repo/cookbooks/active-directory/resources
│ │ ├── chef-repo/cookbooks/active-directory/resources/computer.rb
│ ├── chef-repo/cookbooks/example
│ ├── chef-repo/cookbooks/java < submodule >
│ │ ├── chef-repo/cookbooks/java/Berksfile
│ │ ├── chef-repo/cookbooks/java/recipes
│ │ ├── chef-repo/cookbooks/java/templates
│ ├── chef-repo/cookbooks/redhat_subscription_manager < submodule >
│ └── chef-repo/cookbooks/windows < submodule >
├── chef-repo/data_bags
├── chef-repo/environments
├── chef-repo/roles我知道子模块也不是很受欢迎,所以我采用了这种方法,以便开发人员可以将整个chef-repo作为一个整体进行拉取和克隆,但他们会将代码提交到单个repos中。
有没有更好的方法来做到这一点?
谢谢您:)
发布于 2018-11-09 13:53:19
更好的方法?子模块就足够了,即使您可以查看 (即我的illustrate here)
但是对于子模块,特别是如果你的贡献者仍然在他们各自的子模块repos的主分支上,不要忘记命令:
git submodule update --remote --recursive这将足以将所有子模块更新为其在master上的最新提交。
https://stackoverflow.com/questions/53218046
复制相似问题