-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-env.sh
62 lines (47 loc) · 1.77 KB
/
make-env.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/false
# bootstrap needrun
source $(dirname $0)/needrun.sh || { echo "please download needrun.sh" && return; }
# setup vars, if needed
src=./
# build dependencies
needcmd rpm -q epel-release \
|| needyum https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
|| return
needyum python-pip
# deps for flanker (pip package) which needs cryptography which is built with gcc:
needyum libffi-devel || return
needyum openssl-devel || return
needyum python-virtualenv || return
needyum gcc-c++ || return
needyum make || return
needyum git || return
needtool npm ||
needcmd curl --silent --location https://rpm.nodesource.com/setup_5.x | bash - || { echo "node installation failed" && return; }
needyum nodejs || return
needfile "$src/yum.nginx.repo" /etc/yum.repos.d/ || return
needyum nginx || return
needyum supervisor || return
needfile "$src/yum.mongodb.repo" /etc/yum.repos.d/ || return
needyum mongodb-org || return
# Node JS packages
neednpm bower || return
neednpm less || return
needtool python || return
needtool virtualenv || return
needtool bower || return
needtool lessc || return
needtool pip || return
needfile "$src/supervisor.needrun.ini" /etc/supervisord.d/
needfile "$src/nginx.needrun.conf" /etc/nginx/conf.d/
needcmd bower --allow-root install || { echo "bower install failed" && return; }
[[ ! -d /var/lib/bottle/env ]] && virtualenv --system-site-packages /var/lib/needrun/env
. /var/lib/needrun/env/bin/activate
needcmd pip install -r requirements.txt || { echo "python dependencies failed" && return; }
deactivate
needcmd systemctl enable mongod
needcmd systemctl enable supervisord
needcmd systemctl enable nginx
needcmd systemctl restart mongod
needcmd systemctl restart supervisord
needcmd systemctl restart nginx
echo "environment is ready"