Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using two Linodes to host our application: one for production and one for staging.

I would like to set it up so that when code is pushed to the development branch of our Git repository, the code is automatically deployed to the staging server. And when code is pushed to the master branch, that code is automatically deployed to our production server.

I've seen a couple of scripts similar to GitHubHook which use GitHub's Service Hooks feature, but I can't find any examples where master and development are deployed to different servers entirely (rather than just different subfolders of the same server).

What options are available to me? Any answer that can point me in the right direction would be greatly appreciated!

I can clarify the question if needed :)

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I would highly recommend investing in a CI/Build system such as Jenkins or Atlassian Bamboo.

Bamboo is a nice tool for DevOps and would easily solve your problem. It watches your repos for commits and can kick off automated builds, unit tests, and deployments. You can configure build plans and deployment tasks for your multiple branches.

share|improve this answer
    
Just an update, I ended up with Capistrano and have been super happy! It doesn't deploy automatically on push, but it's only an additional command to pull the respective branch when SSHed into our production/staging/test servers (which we aliased to "deploy"). Thanks again for your answer. –  Andrew Feb 26 at 4:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.