Jump to content

Git as a deployment strategy


proggR

Recommended Posts

I'm trying to think of the best way to deploy production updates for a website I'm working on. Right now I'm toying with the idea of using the master branch of a git repo for production. I would develop from a development branch and when it comes time to roll the updates into production I would make a staging branch from production and merge the develop branch into that, test and merge that into the master branch.

 

With that said, does anyone see any issues with this strategy? What security measured should be taken if this is the process that gets used? I would limit read/write access to known computers using an ssh key. Are there any other things to take into account if I were to use git over ftp for deployment?

 

Any thoughts would be appreciated.

Link to comment
Share on other sites

I use a similar approach on a few projects without issue. I do however have update scripts that ensure no changes had been made (which they shouldn't have been anyway) within the production repo. There are usually a few other things that need to be scripted as well such as making sure permissions are correct and the the dist configs are copied into there correct location but yeah, overall, it works well.

Link to comment
Share on other sites

Good to know, thanks. The place I work has a nightmare of a deployment strategy right now which got me thinking about how I will do it with my own projects. In the past I've just used FTP to copy my "staging" files to production but if I'm using git anyway during development I figured using the master branch for production made sense.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.