-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart-local-env.sh
executable file
·47 lines (36 loc) · 1.16 KB
/
start-local-env.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
#!/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
}
trap stop EXIT
function main {
cd "$repo"
local -r session="organisaatio"
tmux kill-session -t "$session" || true
tmux start-server
tmux new-session -d -s "$session"
tmux select-pane -t 0
tmux send-keys "docker compose down --volumes; docker compose up --force-recreate --renew-anon-volumes" C-m
tmux splitw -v
tmux select-pane -t 1
tmux send-keys "$repo/scripts/run-mocks.sh" C-m
tmux splitw -h
tmux select-pane -t 2
tmux send-keys "$repo/scripts/run-organisaatio-ui.sh" C-m
tmux select-pane -t 0
tmux splitw -h
tmux send-keys "$repo/scripts/run-organisaatio-service.sh" C-m
tmux select-pane -t 1
tmux splitw -v
tmux send-keys "$repo/scripts/run-varda-rekisterointi.sh" C-m
tmux select-pane -t 4
tmux splitw -v
tmux send-keys "$repo/scripts/run-varda-rekisterointi-ui.sh" C-m
open "http://localhost:3003/organisaatio-service/organisaatiot"
open "http://localhost:3000/varda-rekisterointi"
tmux attach-session -t "$session"
}
main "$@"