Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a question regarding workflow in web development. I'm building my project in Symfony, and it's in Git.

Right now, I have three environments, dev (local), staging and prod. The project itself is hosted on GitHub in a private repo.

I'm wondering what a good way is to update the staging & production environments. Should I somehow setup a push based system so I can push the prod/staging branch directly to my server, and use Git hooks to regenerate cache files and run database migrations?

Right now on similar projects I use a manual pull system, where I SSH to the server, pull down changes from the prod Git branch and manually run cache/migrations. This obviously is not ideal.

share|improve this question
    
Whats not ideal with your current way of doing it? We do something similar, except that we tag versions on git and have a script on the server which we tell the tag (version) to pull and deploy. –  Matsemann Jan 27 '13 at 11:53
add comment

3 Answers 3

up vote 1 down vote accepted

I'm now deploying server to staging/production by using command:

git push stating master

git push production master

And finished, I don't have to go to the servers to pull the code.

This is might be the thing you want. Please read on this link http://stackoverflow.com/questions/279169/deploy-a-project-using-git-push

share|improve this answer
add comment

Have you considered a service like Beanstalk or Codebase ? They will host your git repositories, but they also have "native" support for deploying web applications, unlike Github. You would probably still have to write hooks to handle stuff like database migrations, but such services do automate much of the deployment process.

share|improve this answer
add comment

I think your current situation is most ideal, provided that you are not (a) load balancing, and (b) you have automated the regen-refresh-restart cycle once you do the git operation. Too much more automation, and you run the risk of accidental deployments.

There are various complexities related to real-life deployments, such as database modifications, cache-regeneration, minification, etc, web server configurations, etc... What about when you need a new rewrite rule added? Is that automated? It is for us, and I would never do it differently.

If load balancing, then deploy to a "push" server, and rsync from there.

share|improve this answer
add comment

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.