-
Notifications
You must be signed in to change notification settings - Fork 8
/
0.start-kc-oid4vci.sh
executable file
·37 lines (32 loc) · 1.13 KB
/
0.start-kc-oid4vci.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
#!/bin/bash
# Source common env variables
. load_env.sh
# Shutdown keycloak if any
# Determine OS platform and shutdown Keycloak if running
OS=$(uname -s)
case "$OS" in
Linux*|Darwin*)
keycloak_pid=$(pgrep -f keycloak)
if [ -n "$keycloak_pid" ]; then
echo "Keycloak instance found (PID: $keycloak_pid) on $OS. Shutting it down..."
kill $keycloak_pid
fi
;;
*)
echo "This script supports only Linux or macOS."
;;
esac
# Run Build script
./build-kc-oid4vci.sh
# Start database container
if [ -z "${KC_DB_OPTS}" ]; then
echo "Starting database container..."
docker-compose up -d db || { echo 'Could not start database container' ; exit 1; }
KC_DB_OPTS="--db postgres --db-url-port $KC_DB_EXPOSED_PORT --db-url-database $KC_DB_NAME --db-username $KC_DB_USERNAME --db-password $KC_DB_PASSWORD"
fi
# Start keycloak with OID4VCI feature
####
# Use org.keycloak.quarkus._private.IDELauncher if you want to debug through keycloak sources
export KEYCLOAK_ADMIN KEYCLOAK_ADMIN_PASSWORD \
&& cd $KC_INSTALL_DIR \
&& bin/kc.sh $KC_START $KC_DB_OPTS --features=oid4vc-vci &