Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to Build a Git based updatesystem for a multiple hosting-environment in combination with Directa

Jos Last July 9, 2021

Situation We are hosting multiple webshops (open-cart) on multiple servers. Every webshop has its own user environment in DirectAdmin so we can connect a domain to the webshop. The webshops are mostly unique but they can differ in code due to some custom modules we develop for them. The code base is for every webshop the same. Currently updates are excecuted with DirectAdmin (Installatron/FTP). This is a time consuming job and sensitive to errors.

Goal I want to improve te development structure to connect it to Git (Bitbucket). I build a local development server that is connected to Bitbucket. This is working well. We want to connect the different webshops with Bitbucket but we want to control the updates our selves to have control over which webshops are getting a new update and when.

What we have done so far.. I build a new backend and frontend by which I import the different webshops through the DirectAdmin API. I have written a shell script I can upload to the webshops. This shell script is creating a new repository in the webshops' public_html and adds a new remote from Bitbucket. I then try to merge the origin from bitbucket with the existing repo on the server. The point is to have no merge conflicts because everything is handled through the new backend. I first try to reset the repo to origins'master branch, but then important (custom) files are lost like the .htaccess files and custom modules that are not included (yet) in the codebase on Bitbucket. Now it is getting pretty complex due to the diversity of the webshops. I cannot find a solution to automaticly merge the origin/master on the shop without losing files and custom modules.

Tried solutions

  • Different merge strategies (theirs/ours)
  • Working with git reset --hard

What I'm looking for I'm looking for alternatives to set up a proper development structure that fits our server-structure (DirectAdmin /user-packages) and being able to connect this to Git (Bitbucket).

So I hope that someone has been in this case before and have a great Idea! Thanks alot ;)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events