-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello
executable file
·51 lines (40 loc) · 1.15 KB
/
hello
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
#! /usr/bin/env bash
export BASE="$(dirname $PWD/$0)"
export ENV_PATH="$BASE/env"
export TOOL_PATH="$BASE/tools"
export PY_ENV="$BASE/.py"
export PYLIB_PATH="$PY_ENV/lib/python2.7/site-packages"
export ENV_ETC_PATH="$ENV_PATH/etc"
export ENV_RUN_PATH="$ENV_PATH/var/run"
export ENV_LOG_PATH="$ENV_PATH/var/log"
export NGINX_CONFIG_PATH="$ENV_ETC_PATH/nginx"
# !!! DONT'T START WITH UWSGI !!! (...after 1.9.5)
export _UWSGI_VASSAL_PATH="$ENV_ETC_PATH/uwsgi/vassals"
export _UWSGI_DESC='Avalon'
export _UWSGI_NAME='avalon'
if [ -n "${AVALON_ENVIRON}" ]; then
return
fi
if [ -n "$(echo $HOSTNAME | grep iliya)" ]; then
export AVALON_ENVIRON="PRODUCTION"
elif [ -n "$(echo $HOSTNAME | grep qaserver)" ]; then
export AVALON_ENVIRON="STAGING"
else
export AVALON_ENVIRON="DEVELOPMENT"
fi
if [ ! -d $PY_ENV ]; then
virtualenv $PY_ENV
fi
mkdir -p $ENV_ETC_PATH
mkdir -p $ENV_LOG_PATH
mkdir -p $ENV_RUN_PATH
mkdir -p $NGINX_CONFIG_PATH
mkdir -p $_UWSGI_VASSAL_PATH
echo "BASE: $BASE"
echo "PYTHON ENVIRONMENT: $PY_ENV"
echo "TOOL_PATN: $TOOL_PATH"
echo $AVALON_ENVIRON
echo
source $PY_ENV/bin/activate
sh $TOOL_PATH/init
source $TOOL_PATH/functions.sh