Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you deploy a website to your webservers?

At my company we have a group of 8 web developers for our business web site (entirely written in PHP, but that shouldn't matter). Everyone in the group is working on different projects at the same time and whenever they're done with their task, they immediately deploy it (cause business is moving fast these days).

Currently the development happens on one shared server with all developers working on the same code base (using RCS to "lock" files away from others). When deployment is due, the changed files are copied over to a "staging" server and then a sync script uploads the files to our main webserver from where it is distributed over to the other 9 servers.

Quite happily, the web dev team asked us for help in order to improve the process (after us complaining for a while) and now our idea for setting up their dev environment is as follows:

  • A dev server with virtual directories, so that everybody has their own codebase,
  • SVN (or any other VCS) to keep track of changes
  • a central server for testing holding the latest checked in code

The question is now: How do we manage to deploy the changed files on to the server without accidentaly uploading bugs from other projects? My first idea was to simply export the latest revision from the repository, but that would not give full control over the files.

How do you manage such a situation? What kind of deployment scripts do you have in action?

(As a special challenge: the website has organically grown over the last 10 years, so the projects are not split up in small chunks, but files for one specific feature are spread all over the directory tree.)

like image 559
Dan Soap Avatar asked Feb 05 '09 10:02

Dan Soap


People also ask

How do I deploy a website using IIS?

In IIS, right-click the Default Web Site, choose Deploy > Configure Web Deploy Publishing. If you don't see the Deploy menu, see the preceding section to verify that Web Deploy is running. In the Configure Web Deploy Publishing dialog box, examine the settings. Click Setup.

What does it mean to deploy a website?

What does it mean to deploy a website? Deploying a website means that you are deploying changes you have made to your website, typically code, from source control to an environment (typically development, staging, or live).


1 Answers

Cassy - you obviously have a long way to go before you'll get your source code management entirely in order, but it sounds like you are on your way!

Having individual sandboxes will definitely help on things. Next then make sure that the website is ALWAYS just a clean checkout of a particular revision, tag or branch from subversion.

We use git, but we have a similar setup. We tag a particular version with a version number (in git we also get to add a description to the tag; good for release notes!) and then we have a script that anyone with access to "do a release" can run that takes two parameters -- which system is going to be updated (the datacenter and if we're updating the test or the production server) and then the version number (the tag).

The script uses sudo to then run the release script in a shared account. It does a checkout of the relevant version, minimizes javascript and CSS1, pushes the code to the relevant servers for the environment and then restarts what needs to be restarted. The last line of the release script connects to one of the webservers and tails the error log.

On our websites we include an html comment at the bottom of each page with the current server name and the version -- makes it easy to see "What's running right now?"

1 and a bunch of other housekeeping tasks like that...

like image 172
Ask Bjørn Hansen Avatar answered Nov 15 '22 13:11

Ask Bjørn Hansen