source: OpenWorkouts-current/bin/start @ 2142a49

currentfeature/docs
Last change on this file since 2142a49 was 2142a49, checked in by Borja Lopez <borja@…>, 5 years ago

Use ZEO in development mode too.

(we will need it once we start running separated process to run tasks,
like sending queued emails)

Adapted bin/start so it handles starting/stopping ZEO instances.

Added some messages to be shown to the user when running the start script,
helping understanding what the script is doing.

Run pserve in the background, instead of leaving it there on the shell.

Added a bin/stop script that stops pserve and ZEO.

  • Property mode set to 100755
File size: 1.2 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/zeo_stop
16}
17
18# Activate the virtual env
19echo "Activating virtual environment"
20. ${env_path}/bin/activate
21
22# Now ensure all python and js packages are up-to-date
23echo "Installing dependency updates (this may take a moment)"
24yes | pip install --upgrade -e ${current}[testing] > /tmp/ow-start.stdout 2> /tmp/ow-start.stderr
25./bin/js_deps > /tmp/ow-start.stdout 2> /tmp/ow-start.stderr
26
27# Start ZEO (stop if it is running)
28echo "Starting database"
29./bin/zeo_stop >> var/log/zeo_stop.log 2>> var/log/zeo_stop.err &
30./bin/zeo_start >> var/log/zeo_start.log 2>> var/log/zeo_start.err &
31
32# And finally run the server
33echo "Starting OpenWorkouts"
34pserve --reload development.ini >> var/log/pserve.log 2>> var/log/pserve.err &
35echo $! > var/run/pserve.pid
36
37# show the url where the app is accesible
38ow_url=http://`grep listen 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.