-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-local-env.sh
More file actions
executable file
·38 lines (29 loc) · 941 Bytes
/
Copy pathstart-local-env.sh
File metadata and controls
executable file
·38 lines (29 loc) · 941 Bytes
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
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail -o xtrace
readonly repo="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function stop {
cd "$repo"
docker compose down --volumes
}
trap stop EXIT
function main {
cd "$repo"
local -r session="$( basename $( pwd ) )"
tmux kill-session -t "$session" || true
tmux start-server
tmux new-session -d -s "$session"
tmux select-pane -t 0
tmux send-keys "cd $repo; docker compose down --volumes; docker compose up --force-recreate --renew-anon-volumes" C-m
tmux splitw -h
tmux select-pane -t 1
tmux send-keys "$repo/scripts/run-viestinvalitys-ui.sh" C-m
tmux splitw -v
tmux select-pane -t 2
tmux send-keys "$repo/scripts/run-backend.sh" C-m
tmux splitw -v
tmux select-pane -t 3
tmux send-keys "$repo/scripts/run-viestinvalitys-service.sh" C-m
open "http://localhost:3000/viestinvalityspalvelu"
tmux attach-session -t "$session"
}
main "$@"