16 | | rm -rf "/home/web2py/applications/sqlite/databases/*" |
17 | | rm -rf "/home/web2py/applications/sqlite/errors/*" |
18 | | rm -rf "/home/web2py/applications/sqlite/sessions/*" |
19 | | cp -f "/home/web2py/applications/sqlite/deployment-templates/models/000_config.py" "/home/web2py/applications/sqlite/models" |
20 | | sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' "/home/web2py/applications/sqlite/models/000_config.py" |
21 | | sed -i 's|127.0.0.1:8000|sqlite.eden.sahanafoundation.org|' "/home/web2py/applications/sqlite/models/000_config.py" |
22 | | sed -i 's|#deployment_settings.ui.navigate_away_confirm = False|deployment_settings.ui.navigate_away_confirm = False|' "/home/web2py/applications/sqlite/models/000_config.py" |
| 18 | rm -rf /home/web2py/applications/sqlite/databases/* |
| 19 | rm -rf /home/web2py/applications/sqlite/errors/* |
| 20 | rm -rf /home/web2py/applications/sqlite/sessions/* |
| 21 | cp -f /home/web2py/applications/sqlite/deployment-templates/models/000_config.py /home/web2py/applications/sqlite/models |
| 22 | sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' /home/web2py/applications/sqlite/models/000_config.py |
| 23 | sed -i 's|127.0.0.1:8000|sqlite.eden.sahanafoundation.org|' /home/web2py/applications/sqlite/models/000_config.py |
| 24 | sed -i 's|#deployment_settings.ui.navigate_away_confirm = False|deployment_settings.ui.navigate_away_confirm = False|' /home/web2py/applications/sqlite/models/000_config.py |
24 | | sudo -H -u web2py python web2py.py -S sqlite -M -R applications/sqlite/static/scripts/tools/noop.py |
25 | | sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' "/home/web2py/applications/sqlite/models/000_config.py" |
26 | | sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' "/home/web2py/applications/sqlite/models/000_config.py" |
27 | | apache2ctl restart |
| 26 | python web2py.py -S sqlite -M -R applications/sqlite/static/scripts/tools/noop.py |
| 27 | sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' /home/web2py/applications/sqlite/models/000_config.py |
| 28 | sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' /home/web2py/applications/sqlite/models/000_config.py |
| 29 | |
| 30 | sudo /etc/init.d/apache2 restart |
| 32 | |
| 33 | sudo -H -u jenkins /home/update_mysql.sh |
| 34 | {{{ |
| 35 | cd /home/web2py/applications/mysql |
| 36 | bzr pull |
| 37 | rm -rf /home/web2py/applications/mysql/databases/* |
| 38 | rm -rf /home/web2py/applications/mysql/errors/* |
| 39 | rm -rf /home/web2py/applications/mysql/sessions/* |
| 40 | sudo /usr/bin/mysqladmin -f drop sahana |
| 41 | sudo /usr/bin/mysqladmin create sahana |
| 42 | cp -f "/home/web2py/applications/mysql/deployment-templates/models/000_config.py" "/home/web2py/applications/mysql/models" |
| 43 | sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' "/home/web2py/applications/mysql/models/000_config.py" |
| 44 | sed -i 's|127.0.0.1:8000|mysql.eden.sahanafoundation.org|' "/home/web2py/applications/mysql/models/000_config.py" |
| 45 | sed -i 's|database.db_type = "sqlite"|database.db_type = "mysql"|' "/home/web2py/applications/mysql/models/000_config.py" |
| 46 | sed -i 's|database.username = "sahana"|database.username = "root"|' "/home/web2py/applications/mysql/models/000_config.py" |
| 47 | sed -i 's|database.password = "password"|database.password = "eden"|' "/home/web2py/applications/mysql/models/000_config.py" |
| 48 | sed -i 's|#deployment_settings.ui.navigate_away_confirm = False|deployment_settings.ui.navigate_away_confirm = False|' "/home/web2py/applications/mysql/models/000_config.py" |
| 49 | cd ~web2py |
| 50 | #sudo -H -u web2py python web2py.py -S mysql -M -R applications/mysql/static/scripts/tools/noop.py |
| 51 | python web2py.py -S mysql -M -R applications/mysql/static/scripts/tools/noop.py |
| 52 | sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' "/home/web2py/applications/mysql/models/000_config.py" |
| 53 | sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' "/home/web2py/applications/mysql/models/000_config.py" |
| 54 | sudo /etc/init.d/apache2 restart |
| 55 | }}} |
| 56 | |
| 57 | sudo -H -u jenkins /home/update_postgresql.sh |
32 | | rm -rf "/home/web2py/applications/postgresql/databases/*" |
33 | | rm -rf "/home/web2py/applications/postgresql/errors/*" |
34 | | rm -rf "/home/web2py/applications/postgresql/sessions/*" |
35 | | su -c - postgres "dropdb sahana" && true |
36 | | su -c - postgres "createdb -O sahana sahana" |
37 | | su -c - postgres "createlang plpgsql -d sahana" |
38 | | su -c - postgres "psql -q -d sahana -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql" |
39 | | su -c - postgres "psql -q -d sahana -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql" |
40 | | su -c - postgres "psql -q -d sahana -f ~web2py/applications/geometry.sql" |
41 | | su -c - postgres "psql -q -d sahana -f ~web2py/applications/autopopulate.sql" |
| 61 | rm -rf /home/web2py/applications/postgresql/databases/* |
| 62 | rm -rf /home/web2py/applications/postgresql/errors/* |
| 63 | rm -rf /home/web2py/applications/postgresql/sessions/* |
| 64 | sudo /bin/su -c - postgres "dropdb sahana" && true |
| 65 | sudo /bin/su -c - postgres "createdb -O sahana sahana" |
| 66 | sudo /bin/su -c - postgres "createlang plpgsql -d sahana" |
| 67 | sudo /bin/su -c - postgres "psql -q -d sahana -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql" |
| 68 | sudo /bin/su -c - postgres "psql -q -d sahana -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql" |
55 | | cd /home/web2py/applications/mysql |
56 | | bzr pull |
57 | | rm -rf "/home/web2py/applications/mysql/databases/*" |
58 | | rm -rf "/home/web2py/applications/mysql/errors/*" |
59 | | rm -rf "/home/web2py/applications/mysql/sessions/*" |
60 | | mysqladmin -f drop sahana |
61 | | mysqladmin create sahana |
62 | | cp -f "/home/web2py/applications/mysql/deployment-templates/models/000_config.py" "/home/web2py/applications/mysql/models" |
63 | | sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' "/home/web2py/applications/mysql/models/000_config.py" |
64 | | sed -i 's|127.0.0.1:8000|mysql.eden.sahanafoundation.org|' "/home/web2py/applications/mysql/models/000_config.py" |
65 | | sed -i 's|deployment_settings.gis.spatialdb = False|deployment_settings.gis.spatialdb = True|' "/home/web2py/applications/mysql/models/000_config.py" |
66 | | sed -i 's|database.db_type = "sqlite"|database.db_type = "mysql"|' "/home/web2py/applications/mysql/models/000_config.py" |
67 | | sed -i 's|database.password = "password"|database.password = "eden"|' "/home/web2py/applications/mysql/models/000_config.py" |
68 | | sed -i 's|#deployment_settings.ui.navigate_away_confirm = False|deployment_settings.ui.navigate_away_confirm = False|' "/home/web2py/applications/mysql/models/000_config.py" |
69 | | cd ~web2py |
70 | | sudo -H -u web2py python web2py.py -S mysql -M -R applications/mysql/static/scripts/tools/noop.py |
71 | | sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' "/home/web2py/applications/mysql/models/000_config.py" |
72 | | sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' "/home/web2py/applications/mysql/models/000_config.py" |
73 | | apache2ctl restart |
| 89 | UPDATE public.gis_location SET wkt = 'POINT (' || lon || ' ' || lat || ')' WHERE gis_feature_type = 1; |
| 90 | SELECT AddGeometryColumn( 'public', 'gis_location', 'the_geom', 4326, 'GEOMETRY', 2 ); |
| 91 | UPDATE public.gis_location SET the_geom = ST_SetSRID(ST_GeomFromText(wkt), 4326); |