Changes between Version 4 and Version 5 of CodeManagementReleaseProcessOld


Ignore:
Timestamp:
11/22/10 15:39:59 (6 years ago)
Author:
jim
Comment:

done!

Legend:

Unmodified
Added
Removed
Modified
  • CodeManagementReleaseProcessOld

    v4 v5  
    5050{{{ 
    5151ssh dev.transitionnetwork.org.webarch.net 
    52 cd web/dev.transitionnetwork.org.webarch.net/www 
     52cd /web/dev.transitionnetwork.org.webarch.net/www 
    5353svn up 
    5454}}} 
     
    5858 
    5959=== 3. 'Tag' (copy) the release === 
    60 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. 
     60Once 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). 
    6161 
     62You need to SSH into the DEV server and go to the website root folder (as above). Then run these commands to tag the release: 
     63{{{ 
     64svn cp trunk releases/2010-11-19 
     65svn commit -m "Release version 2010-11-19" 
     66}}} 
     67All releases go in the /releases folder on in the SVN repository with the date as the sub folder name. The above commands will make a copy of Trunk as it stands and then move it to a new folder ready for release to TEST or LIVE. 
    6268 
    63  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. 
     69=== 4. Release to LIVE (or TEST) === 
     70Please note the documentation for the LIVE server is here: wiki:NewLiveServer - and you should have decided whether or not it's necessary to do a run of testing on the TEST site before moving to LIVE... The process for both is the same, just on different machines. 
    6471 
    65 '''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. 
     72'''4a. Prepare for release''' by... 
     73 1. SSH into LIVE (or TEST): ssh www.transitionnetwork.org (OR for TEST: ssh test.transitionnetwork.org.webarch.net) 
     74 1. Go to the site root folder {{{ cd /web/transtionnetwork.org/www }}} (OR cd /web/test.transitionnetwork.org.webarch.net/www) 
    6675 
    67 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... 
     76'''4b. Backup & put Drupal into maintenance mode''': You are now ready to take the site down and get the new files onto the server, but first you need to make a backup and prepare in Drupal... 
     77 1. Log in as Transition Admin (user 1 - password available on request) 
     78 1. Go to 'Site configuration' -> 'Site maintenance' and put the site offline. Ideally update message so users can see when the site is likely to be back - allow 15 minutes. 
     79 1. Go to 'Site building' -> 'Backup & migrate' and make a manual backup of the database - saved on the server. 
    6880 
     81'''NOTE''' you will need to do points 2 and 3 above on the http://workspaces.transitionnetwork.org domain too! 
    6982 
    70  
    71  1. OPTIONAL: points 1-5 happen as many times as required to get the release ready, tested and signed off. 
    72  1. 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. 
    73  
    74 == Comment from Chris == 
    75  
    76 Some suggestions: 
    77  
    78 Developers work on the browser:www/trunk and this is tested on [http://test.transitionnetwork.org/ test.transitionnetwork.org] and [http://dev.transitionnetwork.org/ dev.transitionnetwork.org] as required. 
    79  
    80 When the code is ready to be deployed to the live server it's tagged, which is an svn copy, eg: 
    81  
    82 {{{ 
    83   svn cp trunk rel-2010-11-19 
    84   svn commit -m "Release version 2010-11-19" 
    85 }}} 
    86  
    87 Then on the live server this is deployed: 
    88  
     83'''4c. Deploy the new code''': Back in the terminal where you are SSHed into the correct machine AND in the correct site root folder... 
    8984{{{ 
    9085  sudo -i 
    91   cd cd /web/transitionnetwork.org/www/ 
    92   svn switch https://tech.transitionnetwork.org/svn/www/rel-2010-11-19/ . 
     86  svn switch https://tech.transitionnetwork.org/svn/www/release/2010-11-19/ . 
    9387}}} 
     88Using your release date, obviously. After a short while the server will complete the task and you can... 
     89 
     90'''4d. Finish the job''': Go back to Drupal in your browser and... 
     91 1. Go to the 'Database update' page at http://www.transitionnetwork.org/update.php (or test.transitionnetwork.org/update.php) and complete the process. 
     92 1. Go to the homepage, initiatives directory, blogs etc and check the site is looking and behaving like it should. If it isn't you will need to fix the issue. If you can't you will need to roll back - see the next section. 
     93 1. Repeat the update process on the Workspaces subdomain. 
     94 1. Go to 'Site configuration' -> 'Site maintenance' and put the back main site online. And the Workspaces sub-site. 
     95 1. Let everyone who needs to know the site is back and updated. Then have a beer. 
     96 
     97=== 5. Rolling back a release === 
     98If it goes badly, don't panic. You have all the old code in SVN and a snapshot of the database just prior to updating it. To roll back, run the following commands on the server you're logged into: 
     99 1. (Assuming you can still use Drupal) Take the site back offline and go to 'Site building' -> 'Backup & migrate' -> 'Restore' 
     100 1. Restore the database backup just prior to the and make a manual backup of the database - saved on the server. 
     101 
     102(If you can't use Drupal you will need to use the command line to restore the database backup you made. Essentially this consists of going to the sites/default/files folder and getting the database snapshot file you made, then running a command similar to {{{ mysql -u username -p -h localhost data-base-name < data.sql }}}) 
     103 
     104Once the database is back, WITHOUT doing anything more in Drupal, switch the files back: 
     105{{{ 
     106  sudo -i 
     107  svn switch https://tech.transitionnetwork.org/svn/www/release/[the previous release]/ . 
     108}}} 
     109That's the files back so clear the caches and test the site.