source: OpenWorkouts-current/bin/start

current
Last change on this file 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
Line 
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
11# trap control+c, which is what we use to stop pserve, ensuring ZEO is shut down
12trap ctrl_c INT
13
14ctrl_c() {
15    ./bin/uwsgi_stop
16    ./bin/zeo_stop
17}
18
19# Activate the virtual env
20echo "Activating virtual environment"
21. ${env_path}/bin/activate
22
23# Now ensure all python and js packages are up-to-date
24echo "Installing dependency updates (this may take a moment)"
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
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
33# And finally run the server
34echo "Starting OpenWorkouts"
35./bin/uwsgi_start development
36
37# show the url where the app is accesible
38ow_url=http://`grep http etc/uwsgi_development.ini |cut -f 3 -d " "`
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.