From d9fa28d8a05b7cf09c72bfd46e6c0f7cb332c757 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Wed, 2 Aug 2023 18:56:06 +0200 Subject: [PATCH] test postgres --- .../getting-started-with-zitadel.sh | 69 +++++++++++-------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/infrastructure_files/getting-started-with-zitadel.sh b/infrastructure_files/getting-started-with-zitadel.sh index 4d810eb4f..f519ef175 100644 --- a/infrastructure_files/getting-started-with-zitadel.sh +++ b/infrastructure_files/getting-started-with-zitadel.sh @@ -47,10 +47,10 @@ check_jq() { fi } -wait_crdb() { +wait_pgdb() { set +e while true; do - if $DOCKER_COMPOSE_COMMAND exec -T crdb curl -sf -o /dev/null 'http://localhost:8080/health?ready=1'; then + if $DOCKER_COMPOSE_COMMAND exec -T pgdb pg_isready -U postgres; then break fi echo -n " ." @@ -60,15 +60,15 @@ wait_crdb() { set -e } -init_crdb() { +init_pgdb() { echo -e "\nInitializing Zitadel's CockroachDB\n\n" - $DOCKER_COMPOSE_COMMAND up -d crdb + $DOCKER_COMPOSE_COMMAND up -d pgdb echo "" # shellcheck disable=SC2028 echo -n "Waiting cockroachDB to become ready " - wait_crdb - $DOCKER_COMPOSE_COMMAND exec -T crdb /bin/bash -c "cp /cockroach/certs/* /zitadel-certs/ && cockroach cert create-client --overwrite --certs-dir /zitadel-certs/ --ca-key /zitadel-certs/ca.key zitadel_user && chown -R 1000:1000 /zitadel-certs/" - handle_request_command_status $? "init_crdb failed" "" + wait_pgdb + #$DOCKER_COMPOSE_COMMAND exec -T pgdb /bin/bash -c "cp /cockroach/certs/* /zitadel-certs/ && cockroach cert create-client --overwrite --certs-dir /zitadel-certs/ --ca-key /zitadel-certs/ca.key zitadel_user && chown -R 1000:1000 /zitadel-certs/" + handle_request_command_status $? "init_pgdb failed" "" } get_main_ip_address() { @@ -439,7 +439,7 @@ initEnvironment() { mkdir -p machinekey chmod 777 machinekey - init_crdb + init_pgdb echo -e "\nStarting Zidatel IDP for user management\n\n" $DOCKER_COMPOSE_COMMAND up -d caddy zitadel @@ -594,16 +594,25 @@ renderZitadelEnv() { cat <