-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·59 lines (51 loc) · 1.77 KB
/
start.sh
File metadata and controls
executable file
·59 lines (51 loc) · 1.77 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# CVV is a continuous verification visualizer.
# Copyright (c) 2019-2023 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DEFAULT_HOST=localhost
DEFAULT_PORT=8999
DEFAULT_DEPLOYMENT_DIR=deploys
DEFAULT_PID_FILE=${DEFAULT_DEPLOYMENT_DIR}/current.pid
DEFAULT_LOG_FILE=${DEFAULT_DEPLOYMENT_DIR}/current.log
CV_DIR=$(pwd)
host=${DEFAULT_HOST}
port=${DEFAULT_PORT}
log=${DEFAULT_LOG_FILE}
usage()
{
echo "Usage: $0 [--host host] [--port port] [--log log-file]"
echo -e "\t--host change host name (default is ${DEFAULT_HOST})"
echo -e "\t--port change port number (default is ${DEFAULT_PORT})"
echo -e "\t--log change server log file (default is ${DEFAULT_LOG_FILE})"
exit 1
}
while [[ "$1" != "" ]]; do
case $1 in
--host ) shift; host="$1" ;;
--port ) shift; port="$1" ;;
--log ) shift; log="$1" ;;
-h | --help ) usage ;;
* ) usage ;;
esac
shift
done
if [ -z "${log}" ]; then
log=${DEFAULT_LOG_FILE}
fi
echo $$ > ${DEFAULT_PID_FILE}
echo "Starting CV web-interface on ${host}:${port}"
nohup python3 ${CV_DIR}/web/manage.py runserver ${host}:${port} &> ${DEFAULT_LOG_FILE}