-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun_and_deploy.sh
executable file
·48 lines (37 loc) · 981 Bytes
/
run_and_deploy.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
#!/usr/bin/env bash
set -euo pipefail
print_header() {
local -r msg="${1}"
local -r print_leading_space="${2:-true}"
if $print_leading_space; then
echo
fi
echo '--------------------------------------------------------------------------------'
echo "> ${msg} <"
echo '--------------------------------------------------------------------------------'
}
get_ts() {
echo $( date +%s%N | cut -b1-13 )
}
main() {
local -r start=$( get_ts )
print_header 'Pulling latest matches' false
pushd fetcher > /dev/null
node fetch_matches.js
popd > /dev/null
print_header 'Updating database'
pushd parser > /dev/null
./parse_matches.sh
popd > /dev/null
print_header 'Regenerating FE'
pushd frontend > /dev/null
./generate_lookup_data.sh
popd > /dev/null
print_header 'Deploying'
pushd deploy > /dev/null
./deploy.sh
popd > /dev/null
local -r end=$( get_ts )
print_header "Success! Ran in [$(((end-start)/1000))] seconds"
}
main