Different versions of the same configuration file in different branches

We use dotCloud, a virtual host, to run some of our applications. dotCloud deploys applications directly from the git repository and reads a configuration file called dotcloud.yml from this repo to configure and launch the stack.

We have two branches (one set, one set) that are part of the same repo, and they push separate instances of dotCloud. There is a slight difference in the dotcloud.yml file for running each of these instances.

What is the best way to manage this dotcloud.yml file? For the time being, we are just making sure that we try to make dotcloud.yml correct for each branch, but it is constantly being overwritten when we merge the changes from the stage to the main one.

+3
source share
2 answers

You can:

  • version a dotcloud.yml.template
  • version a dotcloud.yml.value.prodand a dotcloud.yml.value.stagingwith the corresponding values ​​for each environment.
  • version a smudge script is responsible for collecting the correct file dotcloud.yml (which will no longer be versioned) depending on the dotCloud instance.

You would declare a smudge script as a filter of the filter contents in the (also version) .gitattributefile :

filter driver

git smudge script , dotcloud.yml.template, dotcloud.yml.

+1

:

  • dotcloud.yml .gitignore, (, dotcloud.yml.staging dotcloud.yml.production), git, dotcloud.yml → dotcloud.yml.production dotcloud push --rsync ( --rsync push, rsync git);
  • dotcloud.yml, (, dotcloud var postinstall script) .
0

All Articles