wiki:CodeManagementReleaseProcessOld

Version 4 (modified by jim, 6 years ago) (diff)

almost there!

JK: This page is nearly there, just needs a gentle tidy

Code Management and Release Process

The code for the site, including all Drupal core, contrib and custom files (but excluding settings and uploaded assets) is stored in an Subversion (SVN) repository available at https://tech.transitionnetwork.org/svn/ and browser:www.

Principles

This process relies upon all developers understanding:

  1. You never hack Drupal core
  2. Developers work on their own machines and check into the DEV branch of the SVN repository (viewable here: browser:www/trunk) ONLY when their code TESTED functional.
  3. The development server (DEV) mirrors the LIVE environment must be used to test this code before moving to LIVE.
  4. There is a TEST server which can also be used as required, but is optional unless there is a lot of development work going on or many developers need to test their work in preparation for a release to LIVE.
  5. The LIVE server ONLY EVER gets tagged releases put on it. Such releases must be tested (both on a local developer machine AND on DEV) prior to release. Hence, the LIVE server moves from one tagged release to the next.
  6. Database backups must happen before each release to LIVE - this way each release on LIVE has an associated database backup.

Software & Getting Started

You obviously must have Subversion installed on your machine to work on this project. The basic SVN command line software available for most platforms in from http://subversion.apache.org/ - however, some very nice applications are also available that integrate into your operating system's graphical interface. Recommended FREE SVN applications with a nice GUI are:

To get started, you need a copy of the code and ideally a web server (Apache), database (MySQL) and Drupal set up on your machine. We assume as a web developer you already have this, but Google and http://drupal.org/start are certainly your friends if not. Once you're set up, please run this command to get a copy of the current development (DEV) code.

cd /the/directory/you'll/be/working/in
svn checkout https://tech.transitionnetwork.org/svn/www/trunk

Once you have this, you will be able to edit files on your machine and then later commit them back to the repository - once TESTED of course! Note that the above checkout DOES NOT contain the Drupal settings.php files, nor any files uploaded to the server. It will contain the site's theme though: you will need to get or create these as needed for your setup and configuration. Please see

Release Process Detail

This process gets you from a basic checkout of the code, through committing and testing, to a proper release on the LIVE server. By now you should have a copy of the code checked out as per the section above.

The process is as follows:

1. Edit you code, test locally

As you modify the source code and theme files on your checked out working copy, the differences between your copy and the Trunk will grow. It's wise therefore to do smaller chunks of work and commit once these specific bits are completed. Clearly, if several developers are working on the same areas at once, you will have to coordinate your work and be more careful.

To update the Trunk (DEV) with the tested changes you've done so far:

cd /the/directory/you're/working/in
svn commit -m "A sensible description of what you've done"

Make sure you add a good description in case someone needs to roll back a commit to fix an issue. Then, repeat this step until you're ready to...

2. Test on the DEV server

This step is critical because the DEV server mirrors the setup on LIVE. Hence any issues or differences you didn't spot whilst working on your local machine can be ironed out here. It also allows you to get feedback on your work so far as required.

Note: To get files onto the server, you must have logged into the development server via SSH - for more on how to do this see wiki:DevelopmentServer#SSHaccess.

ssh dev.transitionnetwork.org.webarch.net
cd web/dev.transitionnetwork.org.webarch.net/www
svn up

The last command brings the DEV site up to the latest Trunk version. Go to http://dev.transitionnetwork.org.webarch.net/ and enjoy the fruits of your labour.

Depending on the changes, you should test properly and then solicit feedback and testing from managers/stakeholders. This is probably on DEV, but could be on TEST if needed.

3. 'Tag' (copy) the release

Once everyone is happy with the DEV site updates, you will need to 'tags' (svn copy) the release so it's ready to be moved onto the LIVE server - or the TEST site if needed, more on that in a moment.

code as appropriate (e.g. v1.3.1 "The crown jewels" etc) as a new copy in the LIVE branch. The source of this should be the DEV branch, since TEST server should only test tagged and ready releases before they make it to LIVE.

OPTIONAL: Test on TEST too: Use the above command, but replace 'dev' with 'test' and go to http://test.transitionnetwork.org.webarch.net/ to see things are ok.

Test away and, if necessary (because several developers are working on the site, or you are preparing a large release) repeat the process on the TEST server...

  1. OPTIONAL: points 1-5 happen as many times as required to get the release ready, tested and signed off.
  2. Developer backs up and updates LIVE using the latest tagged release. NOT USING MERGE!!! Using 'svn switch' in our case. If there is a problem the developer can always switch back to the previous tagged release for LIVE and examine the issue in TEST.

Comment from Chris

Some suggestions:

Developers work on the browser:www/trunk and this is tested on test.transitionnetwork.org and dev.transitionnetwork.org as required.

When the code is ready to be deployed to the live server it's tagged, which is an svn copy, eg:

  svn cp trunk rel-2010-11-19
  svn commit -m "Release version 2010-11-19"

Then on the live server this is deployed:

  sudo -i
  cd cd /web/transitionnetwork.org/www/
  svn switch https://tech.transitionnetwork.org/svn/www/rel-2010-11-19/ .