[wiki:Haiti]
== Release Management for the Haiti Portal ==
We have 3 running instances:
* Production: http://haiti.sahanafoundation.org
* Dev/UAT: http://haiti-orgsdev.sahanafoundation.org
* ~~UAT: http://haiti-test.sahanafoundation.org~~ !ToDo lifeeth
* ~~Development: http://haiti-dev.sahanafoundation.org~~ !ToDo lifeeth
The [BugReportingGuidelines Bug Tracker] should have different views to distinguish between bugs being reported against each version
* !ToDo customise the 'Report Bugs' footer URL to link directly to a new ticket against that version?
We have several Code branches:
* Haiti Portal: https://launchpad.net/sahana/haiti-quake-2010
* Haiti Offline: ''tbc''
* Trunk: https://launchpad.net/sahana/sahanapy
* OR: https://code.launchpad.net/~michael-howden/sahana/haiti-quake-2010 ''to change to being trunk-derived?''
* RMS: https://code.launchpad.net/~uwthw/sahana/rms
* VITA: https://code.launchpad.net/~nursix.org/sahana/vita
=== Release Process ===
Overall responsible Person: Fran
1. Where generic, new code is merged 1st into Trunk by Fran
2. Code is then merged into the Haiti branch by Fran
* RMS is currently Haiti-specific so is merged directly to Haiti branch
3. Code is pulled from the Haiti branch to Dev by lifeeth or chamindra
* Data is 1st synced from Prod
* A 1st draft of a data migration plan is made
4. Code is pulled from the Haiti branch to UAT by lifeeth or chamindra
* Testers to be informed before this via the group: ''tbc''
* Data is 1st synced from Prod
* A more detailed data migration plan is made
5. Code is pulled from the Haiti branch to Prod by Fran (Volunteers welcomed to take over!)
* Sign-off for this to come from the group: ''tbc''
* A careful data migration plan is made
* Backup
* Disable system crontab & put Website into Maintenance Mode
{{{
vim /etc/crontab
#0-59/1 * * * * www-data cd /home/haiti/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1
vim /home/haiti/prod/models/00_db.py
migrate=True
rm /etc/apache2/sites-enabled/prod-ssl
/etc/init.d/apache2 force-reload
/home/haiti/update-prod
/home/haiti/shell-prod
db.export_to_csv_file(open('db.csv','wb'))
Ctrl+D
}}}
* DataMigration
* {{{cd /home/haiti/web2py ; python web2py.py -S prod -M -N}}}
{{{
Ctrl+D
}}}
* Restore Website & Cron
{{{
ln -s /etc/apache2/sites-available/prod-ssl /etc/apache2/sites-enabled
/etc/init.d/apache2 force-reload
vim /home/haiti/prod/models/00_db.py
migrate=False
vim /etc/crontab
0-59/1 * * * * www-data cd /home/haiti/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1
}}}
* BluePrintSynchronisation
=== Technical Details ===
==== Production ====
* haiti.sahanapy.org VM: 212.23.5.4
* /home/haiti/web2py/applications/prod
* /etc/apache2/sites-enabled/prod
* Sqlite
* Web2Py r1544
* Sahana Haiti r547
* Customisations:
* models/00_db.py
* migrate = False
* models/00_settings.py
* auth.settings.registration_requires_verification = True
* auth.settings.registration_requires_approval = True
* models/01_modules.py
{{{
s3.menu_modules.append([T('Home'), False, URL(r=request, c='default', f='open_module', vars=dict(id=1))])
if auth.has_membership(1):
s3.menu_modules.append([T('Admin'), False, URL(r=request, c='default', f='open_module', vars=dict(id=2))])
s3.menu_modules.append([T('Mapping'), False, URL(r=request, c='default', f='open_module', vars=dict(id=3))])
module_id = db(db.s3_module.name == 'or').select()[0].id
s3.menu_modules.append([T('Organizations'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
s3.menu_modules.append([T('People'), False, URL(r=request, c='default', f='open_module', vars=dict(id=4))])
#dvi_group = db(db[auth.settings.table_group_name] == 'DVI').select()[0].id
#if auth.has_membership(dvi_group):
#module_id = db(db.s3_module.name == 'dvi').select()[0].id
#s3.menu_modules.append([T('Victim Identification'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
module_id = db(db.s3_module.name == 'rms').select()[0].id
s3.menu_modules.append([T('Requests'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
}}}
* cron/crontab
{{{
*/5 * * * * root *applications/prod/cron/rms_entry2record.py
*/5 * * * * root *applications/prod/cron/rms_tweet2request.py
}}}
* views/layout_default.html
{{{
}}}
* views/ext.html
{{{
}}}
* views/sahana_scripts_min.html
{{{
}}}
==== UAT ====
* logistics.sahanapy.org VM: 212.23.5.5
* /home/haiti-test/web2py/applications/test
* /etc/apache2/sites-enabled/haiti-test
* [wiki:InstallationGuidelinesMySQL MySQL] ''hopefully''
* Web2Py r1544
* Sahana Haiti r547
* Customisations:
* models/00_db.py
* migrate = False
* db = DAL('mysql://haititest:password@localhost/haititest', pool_size=10)
* models/00_settings.py
* S3_PUBLIC_URL = 'http://haiti-test.sahanafoundation.org'
* auth.settings.registration_requires_verification = True
* auth.settings.registration_requires_approval = True
* cron/crontab
{{{
*/5 * * * * root *applications/test/cron/rms_entry2record.py
*/5 * * * * root *applications/test/cron/rms_tweet2request.py
}}}
* views/ext.html
{{{
}}}
* views/sahana_scripts_min.html
{{{
}}}
==== Dev ====
* logistics.sahanapy.org VM: 212.23.5.5
* /home/haiti-dev/web2py/applications/dev
* /etc/apache2/sites-enabled/haiti-dev
* [wiki:InstallationGuidelinesMySQL MySQL] ''hopefully''
* Web2Py r1544
* Sahana Haiti r547
* Customisations:
* models/00_db.py
* migrate = False
* db = DAL('mysql://haitidev:password@localhost/haitidev', pool_size=10)
* models/01_modules.py
{{{
s3.menu_modules.append([T('Home'), False, URL(r=request, c='default', f='open_module', vars=dict(id=1))])
if auth.has_membership(1):
s3.menu_modules.append([T('Admin'), False, URL(r=request, c='default', f='open_module', vars=dict(id=2))])
s3.menu_modules.append([T('Mapping'), False, URL(r=request, c='default', f='open_module', vars=dict(id=3))])
module_id = db(db.s3_module.name == 'or').select()[0].id
s3.menu_modules.append([T('Organizations'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
module_id = db(db.s3_module.name == 'hms').select()[0].id
s3.menu_modules.append([T('Hospitals'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
s3.menu_modules.append([T('People'), False, URL(r=request, c='default', f='open_module', vars=dict(id=4))])
#dvi_group = db(db[auth.settings.table_group_name] == 'DVI').select()[0].id
#if auth.has_membership(dvi_group):
module_id = db(db.s3_module.name == 'dvi').select()[0].id
s3.menu_modules.append([T('Victims'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
module_id = db(db.s3_module.name == 'rms').select()[0].id
s3.menu_modules.append([T('Requests'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
module_id = db(db.s3_module.name == 'vol').select()[0].id
s3.menu_modules.append([T('Volunteers'), False, URL(r=request, c='default', f='open_module', vars=dict(id=module_id))])
}}}
* models/00_settings.py
* S3_PUBLIC_URL = 'http://haiti-dev.sahanafoundation.org'
* auth.settings.registration_requires_verification = True
* auth.settings.registration_requires_approval = True
* cron/crontab
{{{
*/5 * * * * root *applications/dev/cron/rms_entry2record.py
*/5 * * * * root *applications/dev/cron/rms_tweet2request.py
}}}
* views/ext.html
{{{
}}}
* views/sahana_scripts_min.html
{{{
}}}
Note that UAT & Dev have different Web2Py instances so that:
* We can trial different Web2Py versions on Dev
* Crontab can be separately enabled/disabled
* Sessions are not common between instances
Note that all names/paths include the words 'dev'/'test'/'prod' to minimise chances of confusion as to which site is being altered
----
[wiki:Haiti]