git2consul icon indicating copy to clipboard operation
git2consul copied to clipboard

Practical advice on using branches vs paths and source_root

Open stevenscg opened this issue 9 years ago • 1 comments

The gitter room has been pretty quiet, so I will ask this here.

Does anybody have advice on using branches for different environments (or datacenters) vs constructing the repo with paths for each environments (or datacenters) and configuring source_root??

I started building out a "configuration" repo using branches for "dev", "test", etc, and a top level path for each datacenter ("us", "eu", etc). I haven't spent much time with that arrangement yet, but it seems like it might be a pain to do diffs or pull requests across branches and even to keep changes that should be in sync across environments and/or datacenters.

We already use a "git flow" like workflow with our apps and Ansible projects with feature branches built from a mainline branch, reviewed, and accepted via PR.

I am currently experimenting with using a branch for each stage of the workflow ("dev", "master"), namespacing the data in the repo with "{datacenter}/{environment}", and using the same "{datacenter}/{environment}" as my source_root value.

This is more familiar, but it does mean that I have to pick which environments should track the "dev" branch and which should track the "master" branch.

stevenscg avatar Sep 30 '16 15:09 stevenscg

We're just using one repo for all our environments. We don't currently have differences in the configurations in git2consul between the datacenters. We just use source_root to split which configurations go to which environment and run a copy of git2consul for each environment/datacenter combination.

However, at current due to bugs in source_root I wouldn't recommend this setup. I've submitted a pull request that will fix the problems though: https://github.com/Cimpress-MCP/git2consul/pull/110

breser avatar Oct 29 '16 06:10 breser