-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-dev.sh
executable file
·33 lines (26 loc) · 1018 Bytes
/
setup-dev.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
#!/usr/bin/env bash
set -euo pipefail
[[ "${DEBUG:-false}" == "true" ]] && set -x
SIMPLE_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "${SIMPLE_SCRIPT_DIR}/keycloak/common.sh"
source "${SIMPLE_SCRIPT_DIR}/keycloak/env.sh"
for d in ./data/{apache2,keycloak/mariadb,keycloak/providers,simplesamlphp,simva,traefik}; do
if [[ ! -d "$d" ]]; then
mkdir -p "$d"
fi
done
# Launch this container to generate al required config / dependencies
docker compose up traefik -d
"${SIMPLE_SCRIPT_DIR}/overlay/usr/local/bin/wait-for" -t 60 localhost:80 -- sleep 10 && echo "dev setup finished and traefik running"
# Launch the rest of the containers
docker compose up -d
set +e
sso_ip=$(getent hosts "${KEYCLOAK_SERVER_HOST}")
result=$?
set -e
if [[ "$result" -ne 0 ]]; then
__log "Can't resolve ""${KEYCLOAK_SERVER_HOST}"", check README.md and run the script again"
exit
fi
export KEYCLOAK_IN_CONTAINER=true
"${SIMPLE_SCRIPT_DIR}/keycloak/config-saml-client.sh"