-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-serverchef-components.sh
More file actions
78 lines (60 loc) · 1.83 KB
/
setup-serverchef-components.sh
File metadata and controls
78 lines (60 loc) · 1.83 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
mkdir /opt/serverchef/components -p
cd /opt/serverchef/components
ln -s /opt/serverchef/init-scripts/gotty-runner.sh /opt/serverchef/components/gotty-runner.sh
########################
# ServerChef-UI
########################
if [ ! -d "./serverchef-ui" ]; then
git clone --depth 1 https://github.com/ServerChef/serverchef-ui.git
cd serverchef-ui
else
cd serverchef-ui && git pull
fi
yarn install && yarn run build
########################
# ServerChef System Helpers
########################
cd /opt/serverchef/components
if [ ! -d "./serverchef-system-helpers" ]; then
git clone https://github.com/ServerChef/serverchef-system-helpers.git --depth 1
cd serverchef-system-helpers
else
cd serverchef-system-helpers && git pull
fi
########################
########################
# Gulp task runner
########################
cd /opt/serverchef/components
if [ ! -d "./gulp-task-runner" ]; then
git clone https://github.com/ServerChef/gulp-task-runner.git --depth 1
cd gulp-task-runner
else
cd gulp-task-runner && git pull
fi
npm install --production
npm run build
########################
########################
# Log parser
########################
cd /opt/serverchef/components
if [ ! -d "./log-parser" ]; then
git clone https://github.com/ServerChef/log-parser.git --depth 1
cd log-parser
else
cd log-parser && git pull
fi
npm install --production
npm run build
########################
########################
# copy virtualhost for serverchef.local
########################
if [ ! -f "/etc/nginx/sites-available/serverchef.local" ]; then
ln -s /opt/serverchef/init-scripts/confs/nginx/serverchef.local /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/serverchef.local /etc/nginx/sites-enabled/serverchef.local
fi
systemctl restart supervisord.service
systemctl restart nginx