This repository was archived by the owner on Feb 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbootstrap.sh
More file actions
103 lines (74 loc) · 2.51 KB
/
bootstrap.sh
File metadata and controls
103 lines (74 loc) · 2.51 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
# Start stopwatch
export BEGIN=$(date +%s)
# Load dependencies
. /vagrant/resources/colors.sh
. /vagrant/resources/trycatch.sh
# This script needs admin rights
if [ 0 != $(id -u) ]; then
echox "${text_red}Error:${text_reset} This script must be run as root!"
exit 1
fi
try
(
throwErrors
echox "${text_cyan}Info:${text_reset} Bootstrap started at $(date +'%Y-%m-%d %H:%M:%S %Z')"
echox "${text_cyan}Prepare Debian environment"
/vagrant/bootstrap/prepare-env.sh
/vagrant/resources/analytics.sh -t=event -ec=bootstrap -ea=start
echox "${text_cyan}Setup Let's Encrypt Certbot"
/vagrant/bootstrap/setup-certbot.sh
echox "${text_cyan}Setup certificates"
/vagrant/bootstrap/setup-certificates.sh
echox "${text_cyan}Setup jq"
/vagrant/bootstrap/setup-jq.sh
echox "${text_cyan}Setup PostgresQL"
/vagrant/bootstrap/setup-postgresql.sh
echox "${text_cyan}Build Redis"
/vagrant/bootstrap/build-redis.sh
echox "${text_cyan}Setup Mailcatcher"
/vagrant/bootstrap/setup-mailcatcher.sh
echox "${text_cyan}Build nginx"
/vagrant/bootstrap/build-nginx.sh
echox "${text_cyan}Setup PHP"
/vagrant/bootstrap/setup-php.sh
echox "${text_cyan}Setup PhpRedis"
/vagrant/bootstrap/setup-phpredis.sh
echox "${text_cyan}Setup Composer"
/vagrant/bootstrap/setup-composer.sh
echox "${text_cyan}Setup NPM"
/vagrant/bootstrap/setup-npm.sh
echox "${text_cyan}Setup Newman"
/vagrant/bootstrap/setup-newman.sh
echox "${text_cyan}Setup Yarn"
/vagrant/bootstrap/setup-yarn.sh
echox "${text_cyan}Setup ffmpeg"
/vagrant/bootstrap/setup-ffmpeg.sh
echox "${text_cyan}Build Unreal"
/vagrant/bootstrap/build-unreal.sh
echox "${text_cyan}Build Anope"
/vagrant/bootstrap/build-anope.sh
echox "${text_cyan}Clean up"
/vagrant/bootstrap/cleanup.sh
echox "${text_cyan}Zero disk"
/vagrant/bootstrap/zerodisk.sh
echox "${text_cyan}Installed versions:${text_reset}"
/vagrant/bootstrap/check-versions.sh
NOW=$(date +%s)
DIFF=$(echo "$NOW-$BEGIN" | bc)
MINS=$(echo "$DIFF/60" | bc)
SECS=$(echo "$DIFF%60" | bc)
echox "${text_cyan}Info:${text_reset} Bootstrap ended at $(date +'%Y-%m-%d %H:%M:%S %Z')"
echox "${text_cyan}Info:${text_reset} Bootstrap lasted $MINS mins and $SECS secs"
/vagrant/resources/analytics.sh -t=event -ec=bootstrap -ea=success
/vagrant/resources/analytics.sh -t=timing -utc=bootstrap -utv=duration -utt=$DIFF"000"
)
catch || {
/vagrant/resources/analytics.sh -t=event -ec=bootstrap -ea=fail
case $ex_code in
*)
echox "${text_red}Error:${text_reset} Bootstrap was aborted!"
throw $ex_code
;;
esac
}