How to keep child sites updated?

So I have a website coded in Coldfusion, it is basically a specialized CRM. I sell this to clients. Let's say I sell it to 10 clients...I would take the latest code and roll it out to all of them. Over time any of these clients may ask for changes that is specific to their site.

I'm constantly making changes/bug fixes/new features, etc. to my master code. What is the best way to keep the 10 other sites updated with the shared code that all child sites still contain?

Right now I just use Araxis Merge to compare my master code to their site and copy over changes that are relevant, etc.

I'm just thinking that if this scales to the level I want it to, it will be a nightmare to keep on this updated.

I use git on all sites on my local development environment to track changes but I don't think version control helps in this case.

Thanks for any ideas.

1 answer

  • answered 2018-04-14 14:19 Seanvm

    From your question, it sounds like their code is similar, but site A contains the code for a specific feature, but site B doesn't have that code. I would suggest aiming towards having all the child sites share the exact same codebase.

    Depending on how these child sites are set up, and the level of customization each one has, this may or may not be an easy task. It is quite possible that you will have to do quite a bit of refactoring to get this to work.

    In the long run this is going to make your life much easier as you can deploy all the child sites together using a continuous deployment solution based off a single repo.

    You may already be doing some of this, but here is how I would set it up:

    • Each child site utilizes the same database (or collection of identical databases). The database would have to be set up for multi-tenancy, so each table would have a "child site ID" column.

    • Your code would then conditionally show/hide certain custom functionality for these clients based off the unique child site ID. If each site has its own Application.cfc you could set the site ID in there. You're probably going to end up with a lot of <cfif childSiteID eq 'exampleSiteID'> throughout your code.

    • Once you have every site running on the exact same codebase you can set continuous deployment.

    An example would be to trigger Jenkins with a Github webhook when something gets merged into master. Jenkins would then build a docker container which can then be deployed to the servers. Something like this:

    Essentially what you are doing if you go this route is creating a platform with one source of truth. If you need to make a change for a single site, or all your sites, you would edit a single repo from which all the sites get deployed from.