Reputation: 12080
Here is my company's current process for moving changes from our development server to our production server:
I know this is a horrible way of doing things, but what's the best way to do this? My initial idea was to move all of our code into subversion. Then, when something needs updated, make changes in development, commit to the repository, and then update the production server from the repository.
Anyone have any alternatives / alterations / constructive criticism? Our development team only has 6 people and our code base is a sprinkling of ASP (very old, horrible legacy), PHP (somewhat newer), and Java EE (newest code; all applications built as separate WARs).
Thanks in advance
edit: For development of our Java EE apps, each developer has Glassfish v2 running on his machine. For PHP/ASP, we have a central dev server. For production, we have a server for PHP/ASP (IIS), and another one for Java (Glassfish v2).
Upvotes: 4
Views: 870
Reputation: 1
Capistrano is a great tool, but I find it to be overkill for non-Rails projects. This is a good guide for deploying PHP projects to multiple environments from a repository: http://themetricsystem.rjmetrics.com/2010/02/01/simple-deploy-script-for-php-applications/
Upvotes: 0
Reputation: 17322
As has been said, source control is a definite. It is the tool around which all coding and deployment should happen.
That being said, you might also want to employ a deployment tool like Capistrano or a build tool like Phing.
I use Capistrano to deploy our PHP applicaiton, and using a single terminal command it will:
If anything goes wrong, it will automatically roll back to the last good deployment. It's such a useful tool. Can't recommend it enough.
EDIT: Just realized this wasn't a PHP-only question. Depending on your platform, deployment tools will vary. Capistrano works great for Rails or PHP. Phing is a PHP version of Apache Ant. You might want to inquire as to the best tool for your chosen platform.
Upvotes: 4
Reputation: 400912
As you said, subversion would probably help, in your case : using some version control system is great, and subversion works fine -- and you probably don't need any de-centralized system (like git/mercurial/...).
The main advantages would be :
Though, I would not just use an svn checkout on my production server : OK, it can work fine in some cases, but, especially if you are sometimes modifying files directly on the production server (which you definitly shouldn't do !), you'll end up with troubles (like conflicts) on the production server one day or another...
Yes, you can use svn merge in dry-run, but it's not always enough... And there is no dry-run for svn update -- and a conflict in a PHP file generally means a parse error ; and that's bad when it happens on the production server ^^
Instead, I would :
Oh, and, btw, about the deployment process, you might be interested by the answer I give on this question some time ago : Updating a web app without any downtime
As a sidenote : starting working with this kind of process is not always easy, so :
Upvotes: 1
Reputation: 444
I'd say you're on the right line of thinking. Getting source control, subversion or otherwise, is of vital importance. Then use some sort of continuous integration like CruiseControl to manage either direct deployments or creation of deployment packages. And do absolutely everything you can to make sure no changes take place in production, it really throws a wrench into the whole process.
Upvotes: 1
Reputation: 943
Yep....definately need some kind of source control. Personally I like SVN and feel it's pretty easy to setup.
Before you jump in the deep end though I'd think through how your deployment strategy should work. How do you want to handle concurrent development? Do you want/need a QA or user testing environment that you deploy to? Sit down with the rest of your group and come up with a list of use cases and such to make sure that you're on the same page, your strategy fits, and that you're all onboard with the solution.
Upvotes: 1
Reputation: 6689
You are right, using source code management (subversion, git, mercurial, etc) will make your life much easier.
Here are the basic steps you'll need to take when making changes to the production environment:
Upvotes: 1