forked from nextstrain/nextstrain.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·49 lines (42 loc) · 1.03 KB
/
build.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
#!/usr/bin/env bash
set -eEuo pipefail
on-error() {
exec >&2
echo
echo "Build failed at ${BASH_SOURCE[0]} line ${BASH_LINENO[0]}"
echo
echo "You are responsible for clean up (sorry!)"
exit 1
}
trap on-error ERR
main() {
local step="${1:-all}"
case "$step" in
static)
build-static;;
auspice)
build-auspice;;
all)
echo "Running the nextstrain.org build script"
build-static
build-auspice
echo "Build complete. Next step: \"npm run server\"";;
*)
echo "Unknown build step \"$step\"" >&2
exit 1;;
esac
}
build-static() {
echo "Building the static site (./static-site/public/)"
cd static-site
npm ci
npm run build # build using gatsby. Can take a few minutes.
cd ..
}
build-auspice() {
echo "Building a customised version of auspice"
cd auspice-client
../node_modules/.bin/auspice build --verbose --extend ./customisations/config.json
cd ..
}
main "$@"