Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web applications: Development to Production

Here is my company's current process for moving changes from our development server to our production server:

  1. Files that need updated are brought down from production, to ensure no changes were made in production only (no it shouldn't happen; but yes, it does happen). Old development files are given a ~ prefix as a sort of "backup".
  2. Developer makes necessary changes.
  3. Updated files in development are copied from that server and pasted into the corresponding place on the production server. Old production files are given a ~ prefix as a sort of "backup".

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).

like image 359
Zack Marrapese Avatar asked Feb 28 '23 17:02

Zack Marrapese


1 Answers

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:

  1. Check out a copy of the project from source control
  2. Put in inside versioned deployment folder
  3. Run custom tasks - like writing symlinks to the public folder, running db tasks, switch environment variable from staging to production, etc.
  4. Create a symlink between my app's public folder and the server doc root

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.

like image 93
Bryan M. Avatar answered Mar 06 '23 22:03

Bryan M.