/
run-local
executable file
·49 lines (41 loc) · 1.07 KB
/
run-local
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 -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
root="$(pwd)"
mode=${MODE:-release}
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <application_name>"
echo "Application names available:"
ls ./integration-tests/js-compute/fixtures/
exit 1
fi
application_name="$1"
application_path="$root/integration-tests/js-compute/fixtures/$application_name"
if [ ! -d $application_path ]; then
echo "Application named $application_name does not exist."
echo "Application names available:"
ls ./integration-tests/js-compute/fixtures/
exit 1
fi
case "$mode" in
release)
yarn build
(
cd $application_path
../../replace-host.sh $application_name "https://compute-sdk-test-backend.edgecompute.app"
fastly compute serve --quiet
)
;;
debug)
yarn build:debug
(
cd $application_path
../../replace-host.sh $application_name "https://compute-sdk-test-backend.edgecompute.app"
fastly compute serve --verbose
)
;;
*)
echo "Unknown build type: $mode"
exit 1
;;
esac