Bootstrapp keycloak

This commit is contained in:
Luke Murphy
2020-03-15 13:28:35 +01:00
parent 38999c57c4
commit ee5e0ae84c
5 changed files with 40 additions and 7 deletions

26
sbin/dokku-entrypoint.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
set -eu -o pipefail
setup_root_user() {
set -eu
if ! grep -q "$ADMIN_USER" /opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json; then
if /opt/jboss/keycloak/bin/add-user-keycloak.sh -r master -u "$ADMIN_USER" -p "$ADMIN_PASS"; then
echo "=====> root user added"
else
echo "=====> Failed to add root user"
exit 1
fi
fi
}
main() {
set -eu
setup_root_user
}
main
/usr/bin/entrypoint "$@"