Answers: <p>Personally I'd keep them in separate repositories, for clear customer isolation:</p>
  
  <ul>
  <li>minimal/no risk of unwanted interference between customers</li>
  <li>different access control for different customers is possible</li>
  <li>different CI/CD pipelines and/or configs for different customers is possible</li>
  <li>simpler/standard CI/CD configurations</li>
  <li>clean per-customer repository history</li>
  <li>easier calculation of per customer resource usage</li>
  <li>lower maintenance risks - better to have just a few customers down than all of them at once</li>
  </ul>
  
  <p>I see some cons as well, but IMHO not enough to tip the balance:</p>
  
  <ul>
  <li>more resources needed (one CI/CD pipeline per customer), but these costs can be reflected in the service pricing. And they should get a lot smaller due to automation.</li>
  <li>sharing of configs/procedures across customers becomes difficult</li>
  </ul>
  
  <p>If a unified VCS vision/presentation is desired I'd still keep separate per-customer repositories (thus keeping some/all of the pros above), collectively managed under a single umbrella repository:</p>
  
  <ul>
  <li>the umbrella repository would contain just a manifest file listing the per-customer repositories, their versions and maybe some other relevant info</li>
  <li>changes in one or more of the individual repositories need to be accompanied by corresponding manifest changes in the umbrella repository to advance the overall project</li>
  <li>a small set of wrapper tools would be used to operate at the umbrella repository level but controlling the individual repositories</li>
  </ul>
  
Answers: CC BY-SA 3.0
Answers: 2018-02-28T01:03:56.643Z
Answers: 2018-02-28T01:03:56.643Z
Answers: Dan Cornilescu
Body: <p>Follow-up to <a href="https://devops.stackexchange.com/q/2133/210">this question</a>.</p>
  
  <p>We are in the middle of a transition to Configuration as Code (CaC). At the moment a lot of sites are configured manually. A side effect of this is that so now and then configuration gets broken and nobody knows what happened. By applying CaC the Version Control System (VCS) could be consulted when an environment is broken and then it is easier to figure out the cause of the issue. Another advantage is that people cannot change the configuration directly on the production systems.</p>
  
  <p>One of the comments to this Q&amp;A was whether the configuration is shared between customers. At the moment this is not the case and this is something we would like to prevent as sharing too much could also be a disadvantage as this could cause tangled configuration, i.e. spaghetti.</p>
  
  <p>In summary, there are multiple configuration files per customer site.</p>
  
  <p><strong>Process</strong></p>
  
  <p>When the configuration is changed and merged into master or trunk then the configuration has to be deployed.</p>
  
  <p>There are more than 1000 customer environments that have to be migrated. One approach is to create 1000 VCS repositories. An advantage of this is that a configuration change will result in a deploy to a specific environment, e.g. code pushed to VCS customer0001 will deploy the configuration to customer0001.</p>
  
  <p><strong>Discussion</strong></p>
  
  <p>As there are more than 1000 customers, I wonder whether 1000 repositories will be a good idea in terms of costs, maintenance and so on. What about creating a separate VCS for the configuration and create a folder per customer, i.e. a monorepo. E.g.:</p>
  
  <p><em>VCS repository</em></p>
  
  <ul>
  <li>customer0001
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  <li>customer0002
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  <li>customer0004
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  <li>customer0005
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  <li>customer0998
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  <li>customer0999
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  <li>customer1000
  
  <ul>
  <li>configFileA</li>
  <li>configFileB</li>
  <li>configFileC</li>
  </ul></li>
  </ul>
  
  <p>An advantage is that it is clear that all configuration resides in one repository, but how to trigger a certain build if a certain customer folder change and deploy it to the environment of the customer?</p>
  
  <p>It is possible to create a custom groovy script in Jenkins that does some filtering or use branches in certain VCS repositories like bitbucket, but I wonder whether there are more efficient solutions.</p>
  
  <p><strong>Preferred answer</strong></p>
  
  <p>A table that gives an overview of the pros and cons:</p>
  
  <pre><code>| VCS | Monorepo | CICD     | Pros               | Cons                  | 
  |-----|----------|----------|====================|=======================|
  |     |          | Circleci |                    |                       |
  |-----|----------|----------|--------------------|-----------------------|
  |     | true     | Jenkins  |                    | groovy script required|
                                                   | to filter customer    |
                                                   | folders               |
                              |--------------------|-----------------------|
  |     | false    | Jenkins  | code change results|more than 1000 jenkins |
                              | in deploy to       |jobs required          |
                              | associated customer|                       | 
                              | environment        |                       |
  |                           |--------------------|-----------------------|
  | git |          |          |                    |                       |
  </code></pre>
  
Comments: CC BY-SA 3.0
Comments: 2018-02-28T00:07:53.893Z
Comments: Do you have any configs shared across multiple customers?
Comments: Dan Cornilescu
Comments: CC BY-SA 3.0
Comments: 2018-02-28T00:25:38.203Z
Comments: I will update the question. Initially we will not share the config and use one config file per customer.
Comments: 030
Tags: <configuration><monorepo><vcs><cicd>
Title: What are Pros and Cons of various VCS and CI/CD tools to store, change and deploy configuration snippets of more than 1000 customers in a VCS?
UserDisplayName: 030
ThreadText: # What are Pros and Cons of various VCS and CI/CD tools to store, change and deploy configuration snippets of more than 1000 customers in a VCS?
  
  (Asked by: username_0 on 2018-02-27)
  
  Follow-up to [this question](https://devops.stackexchange.com/q/2133/210).
  
  We are in the middle of a transition to Configuration as Code (CaC). At the moment a lot of sites are configured manually. A side effect of this is that so now and then configuration gets broken and nobody knows what happened. By applying CaC the Version Control System (VCS) could be consulted when an environment is broken and then it is easier to figure out the cause of the issue. Another advantage is that people cannot change the configuration directly on the production systems.
  
  One of the comments to this Q&A was whether the configuration is shared between customers. At the moment this is not the case and this is something we would like to prevent as sharing too much could also be a disadvantage as this could cause tangled configuration, i.e. spaghetti.
  
  In summary, there are multiple configuration files per customer site.
  
  **Process**
  
  When the configuration is changed and merged into master or trunk then the configuration has to be deployed.
  
  There are more than 1000 customer environments that have to be migrated. One approach is to create 1000 VCS repositories. An advantage of this is that a configuration change will result in a deploy to a specific environment, e.g. code pushed to VCS customer0001 will deploy the configuration to customer0001.
  
  **Discussion**
  
  As there are more than 1000 customers, I wonder whether 1000 repositories will be a good idea in terms of costs, maintenance and so on. What about creating a separate VCS for the configuration and create a folder per customer, i.e. a monorepo. E.g.:
  
  *VCS repository*
  
  * customer0001
    + configFileA
    + configFileB
    + configFileC
  * customer0002
    + configFileA
    + configFileB
    + configFileC
  * customer0004
    + configFileA
    + configFileB
    + configFileC
  * customer0005
    + configFileA
    + configFileB
    + configFileC
  * customer0998
    + configFileA
    + configFileB
    + configFileC
  * customer0999
    + configFileA
    + configFileB
    + configFileC
  * customer1000
    + configFileA
    + configFileB
    + configFileC
  
  An advantage is that it is clear that all configuration resides in one repository, but how to trigger a certain build if a certain customer folder change and deploy it to the environment of the customer?
  
  It is possible to create a custom groovy script in Jenkins that does some filtering or use branches in certain VCS repositories like bitbucket, but I wonder whether there are more efficient solutions.
  
  **Preferred answer**
  
  A table that gives an overview of the pros and cons:
  
  ```
  | VCS | Monorepo | CICD     | Pros               | Cons                  | 
  |-----|----------|----------|====================|=======================|
  |     |          | Circleci |                    |                       |
  |-----|----------|----------|--------------------|-----------------------|
  |     | true     | Jenkins  |                    | groovy script required|
                                                   | to filter customer    |
                                                   | folders               |
                              |--------------------|-----------------------|
  |     | false    | Jenkins  | code change results|more than 1000 jenkins |
                              | in deploy to       |jobs required          |
                              | associated customer|                       | 
                              | environment        |                       |
  |                           |--------------------|-----------------------|
  | git |          |          |                    |                       |
  
  ```
  
  **Tags:** configuration, monorepo, vcs, cicd
  
  > **Comments:**
  > **username_1**: Do you have any configs shared across multiple customers?  
  > **username_0**: I will update the question. Initially we will not share the config and use one config file per customer.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-28. Score: 3 | Accepted answer
  
  Personally I'd keep them in separate repositories, for clear customer isolation:
  
  * minimal/no risk of unwanted interference between customers
  * different access control for different customers is possible
  * different CI/CD pipelines and/or configs for different customers is possible
  * simpler/standard CI/CD configurations
  * clean per-customer repository history
  * easier calculation of per customer resource usage
  * lower maintenance risks - better to have just a few customers down than all of them at once
  
  I see some cons as well, but IMHO not enough to tip the balance:
  
  * more resources needed (one CI/CD pipeline per customer), but these costs can be reflected in the service pricing. And they should get a lot smaller due to automation.
  * sharing of configs/procedures across customers becomes difficult
  
  If a unified VCS vision/presentation is desired I'd still keep separate per-customer repositories (thus keeping some/all of the pros above), collectively managed under a single umbrella repository:
  
  * the umbrella repository would contain just a manifest file listing the per-customer repositories, their versions and maybe some other relevant info
  * changes in one or more of the individual repositories need to be accompanied by corresponding manifest changes in the umbrella repository to advance the overall project
  * a small set of wrapper tools would be used to operate at the umbrella repository level but controlling the individual repositories
  
  
  ---
  
  