-
Notifications
You must be signed in to change notification settings - Fork 48
/
build.sh
executable file
·48 lines (41 loc) · 1.12 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
#!/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-auspice
build-static # Depends on Auspice being built
echo "Build complete. Next step: \"npm run server\"";;
*)
echo "Unknown build step \"$step\"" >&2
exit 1;;
esac
}
build-static() {
echo "Building the static Next.JS app (pages defined in static-site/pages, assets written to static-site/.next)"
npm run build:feeds
./node_modules/.bin/next build static-site
}
build-auspice() {
echo "Building a customised version of auspice"
cd auspice-client
npm ci --ignore-scripts
./node_modules/.bin/auspice build --verbose --extend ./customisations/config.json
cd ..
}
main "$@"