wiki:SysAdmin/Jenkins

Version 1 (modified by Fran Boon, 11 years ago) ( diff )

--

Jenkins: CI

We use Jenkins to do Continous Integration by running our Selenium Functional tests:

We have 3 separate server environments for Eden, each with it's own Apache virtual host:

  • /home/web2py/applications/sqlite
  • /home/web2py/applications/mysql
  • /home/web2py/applications/postgresql

Update scripts:

cd /home/web2py/applications/sqlite
bzr pull
rm -rf "/home/web2py/applications/sqlite/databases"
rm -rf "/home/web2py/applications/sqlite/errors"
rm -rf "/home/web2py/applications/sqlite/sessions"
cp -f "/home/web2py/applications/sqlite/deployment-templates/models/000_config.py" "/home/web2py/applications/sqlite/models"
sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' "/home/web2py/applications/sqlite/models/000_config.py"
sed -i 's|127.0.0.1:8000|sqlite.eden.sahanafoundation.org|' "/home/web2py/applications/sqlite/models/000_config.py"
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"
cd ~web2py
sudo -H -u web2py python web2py.py -S sqlite -M -R applications/sqlite/static/scripts/tools/noop.py
sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' "/home/web2py/applications/sqlite/models/000_config.py"
sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' "/home/web2py/applications/sqlite/models/000_config.py"
apache2ctl restart
cd /home/web2py/applications/postgresql
bzr pull
rm -rf "/home/web2py/applications/postgresql/databases"
rm -rf "/home/web2py/applications/postgresql/errors"
rm -rf "/home/web2py/applications/postgresql/sessions"
su -c - postgres "dropdb sahana" && true
su -c - postgres "createdb -O sahana sahana"
su -c - postgres "createlang plpgsql -d sahana"
su -c - postgres "psql -q -d sahana -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql"
su -c - postgres "psql -q -d sahana -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql"
su -c - postgres "psql -q -d sahana -f ~web2py/applications/geometry.sql"
su -c - postgres "psql -q -d sahana -f ~web2py/applications/autopopulate.sql"
cp -f "/home/web2py/applications/postgresql/deployment-templates/models/000_config.py" "/home/web2py/applications/postgresql/models"
sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' "/home/web2py/applications/postgresql/models/000_config.py"
sed -i 's|127.0.0.1:8000|postgresql.eden.sahanafoundation.org|' "/home/web2py/applications/postgresql/models/000_config.py"
sed -i 's|database.db_type = "sqlite"|database.db_type = "postgres"|' "/home/web2py/applications/postgresql/models/000_config.py"
sed -i 's|database.password = "password"|database.password = "eden"|' "/home/web2py/applications/postgresql/models/000_config.py"
sed -i 's|#deployment_settings.ui.navigate_away_confirm = False|deployment_settings.ui.navigate_away_confirm = False|' "/home/web2py/applications/postgresql/models/000_config.py"
cd ~web2py
sudo -H -u web2py python web2py.py -S postgresql -M -R applications/postgresql/static/scripts/tools/noop.py
sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' "/home/web2py/applications/postgresql/models/000_config.py"
sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' "/home/web2py/applications/postgresql/models/000_config.py"
apache2ctl restart
cd /home/web2py/applications/mysql
bzr pull
rm -rf "/home/web2py/applications/mysql/databases"
rm -rf "/home/web2py/applications/mysql/errors"
rm -rf "/home/web2py/applications/mysql/sessions"
mysqladmin -f drop sahana
mysqladmin create sahana
cp -f "/home/web2py/applications/mysql/deployment-templates/models/000_config.py" "/home/web2py/applications/mysql/models"
sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' "/home/web2py/applications/mysql/models/000_config.py"
sed -i 's|127.0.0.1:8000|mysql.eden.sahanafoundation.org|' "/home/web2py/applications/mysql/models/000_config.py"
sed -i 's|deployment_settings.gis.spatialdb = False|deployment_settings.gis.spatialdb = True|' "/home/web2py/applications/mysql/models/000_config.py"
sed -i 's|database.db_type = "sqlite"|database.db_type = "mysql"|' "/home/web2py/applications/mysql/models/000_config.py"
sed -i 's|database.password = "password"|database.password = "eden"|' "/home/web2py/applications/mysql/models/000_config.py"
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"
cd ~web2py
sudo -H -u web2py python web2py.py -S mysql -M -R applications/mysql/static/scripts/tools/noop.py
sed -i 's|deployment_settings.base.migrate = True|deployment_settings.base.migrate = False|' "/home/web2py/applications/mysql/models/000_config.py"
sed -i 's|deployment_settings.base.prepopulate = True|deployment_settings.base.prepopulate = False|' "/home/web2py/applications/mysql/models/000_config.py"
apache2ctl restart
Note: See TracWiki for help on using the wiki.