Skip to content

Commit

Permalink
Upd: Run keycloak during make setup
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Nov 15, 2023
1 parent 0dadbbf commit 9705178
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/scripts/setup-development-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -x
cd "$(dirname "${BASH_SOURCE[@]}")"

CONTAINER_MONGO="mongo"
CONTAINER_KEYCLOAK="keycloak"

# Check for configuration file
CONFIG_PATH="${PWD}/../config"
Expand All @@ -14,6 +15,8 @@ CONFIG_FILE="${CONFIG_PATH}/config-development.json"
MONGODB_USER=$(jq -r .DataBase.username< "$CONFIG_FILE")
MONGODB_PASSWORD=$(jq -r .DataBase.password < "$CONFIG_FILE")
MONGODB_DATABASE=$(jq -r .DataBase.name < "$CONFIG_FILE")
KEYCLOAK_USER=$(jq -r .Iam.AdminUser< "$CONFIG_FILE")
KEYCLOAK_PASSWORD=$(jq -r .Iam.AdminPassword < "$CONFIG_FILE")

(docker ps -af "name=${CONTAINER_MONGO}" | grep "${CONTAINER_MONGO}" > /dev/null) && docker rm -f "${CONTAINER_MONGO}" > /dev/null

Expand All @@ -39,3 +42,11 @@ docker run -d \
#while ! docker exec mongo mysqladmin ping -h"127.0.0.1" -u"$MYSQL_USER" -p"$MYSQL_PASS" --silent &> /dev/null; do
# sleep 1
#done
docker run -d \
--name "$CONTAINER_KEYCLOAK" \
-e KEYCLOAK_USER="$KEYCLOAK_USER" \
-e KEYCLOAK_PASSWORD="$KEYCLOAK_PASSWORD" \
-e DB_VENDOR="h2" \
-v keycloak-datadir:/opt/jboss/keycloak/standalone/data \
-p 8080:8080 \
jboss/keycloak:latest # Use the appropriate Keycloak image and ports

0 comments on commit 9705178

Please sign in to comment.