source: OpenWorkouts-current/bin/start @ 8ee2af5

current
Last change on this file since 8ee2af5 was 8ee2af5, checked in by Borja Lopez <borja@…>, 5 years ago

Added the scripts and config files to run uwsgi instead of pserve
for development.

This fixes a problem that caused pserve to hang up forever when
several ajax requests were sent to generate screenshots of workout
maps (pserve does not handle concurrent requests very well).

After pulled this change, you can start the app manually using the
uwsgi_start helper::

./bin/uwsgi_start development

Or just use the ./bin/start script, which takes care also of starting
ZEO and several other steps.

  • Property mode set to 100755
File size: 1.1 KB
RevLine 
[2d2898b]1#!/bin/sh
2#
3# Script to start OpenWorkouts
4#
5
6# Full path to where we run the script from
7current=`pwd`
8# Full path to the env
9env_path=${current}/env
10
[2142a49]11# trap control+c, which is what we use to stop pserve, ensuring ZEO is shut down
12trap ctrl_c INT
13
14ctrl_c() {
[8ee2af5]15    ./bin/uwsgi_stop
[2142a49]16    ./bin/zeo_stop
17}
18
[f713dbc]19# Activate the virtual env
[2142a49]20echo "Activating virtual environment"
[2d2898b]21. ${env_path}/bin/activate
[f713dbc]22
23# Now ensure all python and js packages are up-to-date
[2142a49]24echo "Installing dependency updates (this may take a moment)"
[f713dbc]25yes | pip install --upgrade -e ${current}[testing] > /tmp/ow-start.stdout 2> /tmp/ow-start.stderr
26./bin/js_deps > /tmp/ow-start.stdout 2> /tmp/ow-start.stderr
27
[2142a49]28# Start ZEO (stop if it is running)
29echo "Starting database"
30./bin/zeo_stop >> var/log/zeo_stop.log 2>> var/log/zeo_stop.err &
31./bin/zeo_start >> var/log/zeo_start.log 2>> var/log/zeo_start.err &
32
[f713dbc]33# And finally run the server
[2142a49]34echo "Starting OpenWorkouts"
[8ee2af5]35./bin/uwsgi_start development
[2142a49]36
37# show the url where the app is accesible
[8ee2af5]38ow_url=http://`grep http etc/uwsgi_development.ini |cut -f 3 -d " "`
[2142a49]39echo "Open this url in your browser to access the app: ${ow_url}"
40# open ${ow_url}
Note: See TracBrowser for help on using the repository browser.