Version 3 (modified by jim, 6 years ago) (diff) |
---|
Table of Contents
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:
- You never hack Drupal core
- 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.
- The development server (DEV) mirrors the LIVE environment must be used to test this code before moving to LIVE.
- 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.
- 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.
- 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:
- Windows: TortoiseSVN - http://tortoisesvn.net/downloads
- Linux: RabbitVCS - http://wiki.rabbitvcs.org/wiki/download
- Mac: Not sure, all seems commercial - anyone know better?
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 with the tested changes you've done so far:
cd /the/directory/you're/working/in svn up
Repeat this step until you're ready to test it all.
2. Test on the DEV server
- OPTIONAL: Developer updates the TEST server using same code.
- OPTIONAL: Developer solicits feedback and testing from managers/stakeholders if complex changes or new development. This is probably on DEV, but could be on TEST.
- Once happy, developer tags the 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: points 1-5 happen as many times as required to get the release ready, tested and signed off.
- 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/ .