The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dev, Staging, Live sites via Git?

Discussion in 'General Discussion' started by Richard Edwards, Jun 16, 2016.

  1. Richard Edwards

    Mar 7, 2016
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hi all,

    These days most people have a set up where they work locally, deploy to a staging/build server and have a live/production server for the live site.

    In the middle would likely be a git repo.

    This is possible when not using cpanel by a well managed system with a great devops team.

    However, has anyone had any luck or know of a good way to accomplish this with a cPanel driven server?

    My set up:
    Local MAMP setup - working on git repos locally
    cPanel Server - I have an account which I put all my dev sites under - 1 account, multiple subdomains. This is my staging environment.
    cPanel Server - Has multiple other accounts of live sites.

    I know I should probably have a separate server for staging rather than the same one, but costs are tight for now (If I had a separate server I could use the import function from cpanel->cpanel to deploy from staging to live, I am aware)

    I have git running (via gitlab). I am currently ssh'ing to the staging and dev accounts to init the git repo. I then end up having to have ssh access open on all accounts, and an ssh key in each account to work with Gitlab (accounts cannot access outside their home dir).

    This is obviously a step above deleting and uploading a new site between versions, but it does mean doing a manual database update and sshing to do a git pull.

    Is there any good addons out there that could make it a bit less manual - at least a git one to save the sshing? I understand a lot of it depends on the website structure and type of website (for example, ecommerce sites are nigh upon impossible to make database changes to without writing sql scripts to run when deploying updates rather than a database copy)
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    May 20, 2003
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

Share This Page