forked from sjyk/sampleclean-async
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-all-local.sh
executable file
·45 lines (40 loc) · 1.04 KB
/
run-all-local.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# This file runs both the python and the scala code using reasonable defaults
# for production assuming a deployment on ec2 using the deploy scripts in the
# repo.
#
# This script assumes that if you have virtualenvwrapper installed, its
# script is located at /usr/local/bin/virtualenvwrapper.sh. If you aren't using
# virtualenvs, this script will also work.
#
# Usage: ./run-all-local.sh [-s] [MAIN_CLASS]
# Arguments:
# -s: Run the crowd server with ssl
# MAIN_CLASS: the scala application class to run. If not specified, sbt will
# prompt the user to choose.
# Enable SSL
if [ "$1" == "-s" ]
then
export SSL=1
main_class="$2"
else
export SSL=0
main_class="$1"
fi
# Activate the virtualenv if it exists.
if [ -e "/usr/local/bin/virtualenvwrapper.sh" ]
then
source /usr/local/bin/virtualenvwrapper.sh
workon sampleclean
fi
# Start the crowd server
pushd src/main/python/crowd_server
./run.sh $@
popd
# Run the scala code
if [ -z "$main_class" ]
then
./sbt/sbt run
else
./sbt/sbt "run-main $main_class"
fi