-
Notifications
You must be signed in to change notification settings - Fork 9
/
run
executable file
·30 lines (19 loc) · 854 Bytes
/
run
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
#!/usr/bin/env bash
function stop_containers {
docker stop demo_ps-redis || true
docker rm demo_ps-redis || true
docker stop demo_ps-purerl || true
docker rm demo_ps-purerl || true
}
stop_containers
docker run --name demo_ps-redis --publish 6379:6379 -d redis
if ! command -v erl &> /dev/null
then
echo "erl not found, launching docker container instead"
./run_docker_image.sh rebar3 release && erl -init_debug +sbwt none -pa _build/default/lib/*/ebin _checkouts/*/ebin -boot _build/default/rel/demo_ps/releases/1/start -config release-files/sys.config
exit
else
echo "erl found locally, assuming the environment is good to go"
rebar3 release && erl -init_debug +sbwt none -pa _build/default/lib/*/ebin _checkouts/*/ebin -boot _build/default/rel/demo_ps/releases/1/start -config release-files/sys.config
fi
stop_containers