3 ms·
Development / Staging / Production Best Practices
We are a small team of web developers with currently one shared LAMP Development server. Currently we develop on the Development server and then deploy straight to our Production server. We are deploying a second server which will act as our Staging server.
I am interested in hearing from the HN community on best practices for Development / Staging / Production servers. I would like to automate transferring files/database from Development to staging to Production much as possible as we are a small team.
What practices do you use to maintain your web development servers? We don't currently use any source code version control software so I would especially be interested in hearing how subversion git/etc can help. Thank you.
- jamesbritt 16y ago"We don't currently use any source code version control software so I would especially be interested in hearing how subversion git/etc can help." Wow. The funny thing is, I hear this quite a lot from self-described "Web developers". I don't quite get how anyone can do any sort of development for very long without using a version control tool, but it seems quite common among the "Designers who know just enough PHP" crowd. My deployment process revolves around using git (and before that it was mercurial, and before that, svn). Rather than get into any details on it, you should first get acquainted with git and/or mercurial, learn why these kinds of tools are essential, and then get an understanding of deployment strategies. These might be helpful: http://people.canonical.com/~ianc/papers/dvcs-why-and-how.xhtml http://people.canonical.com/~ianc/papers/dvcs-why-and-how.xh... http://stackoverflow.com/questions/2704996/describe-your-workflow-of-using-version-control-vcs-or-dvcs http://stackoverflow.com/questions/2704996/describe-your-wor... http://pythonnewbie.wordpress.com/2009/12/23/distributed-version-control-is-the-future/ http://pythonnewbie.wordpress.com/2009/12/23/distributed-ver...
- user90 16y agoYes, we are aware that adopting version control is well overdue. Thanks for the links!
- Travis 16y agoI break more of these rules than I obey. 1. version control. get it. force it to be used. I use SVN but I'd recommend using git or mercurial. Doesn't matter as long as it's a newer one (CVS, yech). 2. automate. automate everything. You should be able to run a commit, then click a button to update your new staging server. One click deploy to production. ALSO - make sure you can one click UNdeploy. I'd suggest writing shell scripts that will automatically check out the correct revision, move pointers around, change permissions, etc. 3. Make all your environments as similar as possible (same versions of code, etc.) Other than that, I can't think of much. You don't need to use capistrano to manage your deployments -- just use some simple shell scripts with rsync! I'd recommend that your production and dev servers (hardware or VPS) be different. That way if you screw something up while developing, it wont put a load on your production system.
- user90 16y agoThanks for the reply. Can you further expand on the one-click deploy to staging/production? Which tools/methods/scripts do you use?