blob: 5536c3e106a1b6dcc9c419be2360fa0f6dca9072 (
plain)
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
59
60
61
62
63
64
|
#!/bin/echo ERROR: This script needs to be sourced. Please run as .
#
# Prepare virtual environment for SRTool
#
# $ . prepare_environment.sh
#
# Prepare local venv for Python
echo "* Python venv ..."
if [ ! -d ".venv" ] ; then
# sudo apt install python3.10-venv
python3 -m venv .venv
fi
# Start Venv
source .venv/bin/activate
# Source the standard SRT environment settings
echo "* srt_env.sh ..."
if [ ! -f "./srt_env.sh" ] ; then
cp bin/dev_tools/* .
fi
# Set the fundamental environment settings
# Specify environment (even if cwd is in the "lib" directory due to Apache)
echo "* SRTool basic environment ..."
export SRT_BASE_DIR="$(pwd)"
export SRT_BASE_DIR="$(echo $SRT_BASE_DIR | sed -e 's|lib/||')"
export SRT_MODE="Studio_Prodution"
# Python 3 support
if [ -z "$TZ" ] ; then
export TZ="America/Los_Angeles"
fi
# HTTPS support (Apache)
#export SRT_CSRF_TRUSTED_ORIGINS="https://hostname.company.com"
# Quick development log
export SRTDBG_LOG="$SRT_BASE_DIR/srt_dbg.log"
# Override the standard settings
echo "* SRTool custom development environment ..."
export SRT_PORT="9000"
export SRT_SKIP_AUTOUPDATE=0
export SRTDBG_MINIMAL_DB=0
export SRTDBG_SKIP_DEFECT_IMPORT=1
export SRTDBG_SKIP_CVE_IMPORT=0
export SRTDBG_SKIP_CPE_IMPORT=1
# Email credentials
export SRT_EMAIL_SMTP="smtp.org.com"
export SRT_EMAIL_PASSWD="temp_password"
export SRT_EMAIL_USER="temp_user"
export SRT_EMAIL_FROM="temp_user@org.com"
# Defect (e.g. Jira) credentials
export SRT_DEFECT_PASSWD="temp_password"
export SRT_DEFECT_USER="temp_user"
echo "* SRTool Python requirements ..."
pip3 install -r bin/srtool-requirements.txt
echo "* SRTool running on port $SRT_PORT"
|