-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function is_keycloak_running { | ||
local http_code=$(curl -s -o /dev/null -w "%{http_code}" http://$(hostname -i):8080/auth/admin/realms) | ||
local http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/auth/admin/realms) | ||
if [[ $http_code -eq 401 ]]; then | ||
return 0 | ||
else | ||
|
@@ -15,19 +15,19 @@ function configure_user_passwords { | |
for i in ${LAGOON_DEMO_USERS[@]} | ||
do | ||
echo Configuring password for $i | ||
/opt/jboss/keycloak/bin/kcadm.sh set-password --config $CONFIG_PATH --username $i -p $i --target-realm Lagoon | ||
/opt/keycloak/bin/kcadm.sh set-password --config $CONFIG_PATH --username $i -p $i --target-realm Lagoon | ||
done | ||
|
||
for i in ${LAGOON_DEMO_ORG_USERS[@]} | ||
do | ||
echo Configuring password for $i | ||
/opt/jboss/keycloak/bin/kcadm.sh set-password --config $CONFIG_PATH --username $i -p $i --target-realm Lagoon | ||
/opt/keycloak/bin/kcadm.sh set-password --config $CONFIG_PATH --username $i -p $i --target-realm Lagoon | ||
done | ||
} | ||
|
||
function configure_platformowner { | ||
echo Configuring platform owner role | ||
/opt/jboss/keycloak/bin/kcadm.sh add-roles --uusername [email protected] --rolename platform-owner --config $CONFIG_PATH --target-realm Lagoon | ||
/opt/keycloak/bin/kcadm.sh add-roles --uusername [email protected] --rolename platform-owner --config $CONFIG_PATH --target-realm Lagoon | ||
} | ||
|
||
function configure_keycloak { | ||
|
@@ -37,11 +37,11 @@ function configure_keycloak { | |
done | ||
|
||
# Set the config file path because $HOME/.keycloak/kcadm.config resolves to /opt/jboss/?/.keycloak/kcadm.config for some reason, causing it to fail | ||
CONFIG_PATH=/opt/jboss/keycloak/standalone/data/.keycloak/kcadm.config | ||
CONFIG_PATH=/tmp/kcadm.config | ||
|
||
echo Keycloak is running, proceeding with configuration | ||
|
||
/opt/jboss/keycloak/bin/kcadm.sh config credentials --config $CONFIG_PATH --server http://$(hostname -i):8080/auth --user $KEYCLOAK_USER --password $KEYCLOAK_PASSWORD --realm master | ||
/opt/keycloak/bin/kcadm.sh config credentials --config $CONFIG_PATH --server http://localhost:8080/auth --user $KEYCLOAK_USER --password $KEYCLOAK_PASSWORD --realm master | ||
|
||
configure_user_passwords | ||
configure_platformowner | ||
|