Usage with docker #
you can also use keycloakmigraiton with docker. The migrations are then controlled trough environment variables and mounted volumes.
Usage #
docker run --env BASEURL=http://localhost:8080 klg71/keycloakmigration
Environment variables #
-
KEYCLOAK_CHANGELOGmigration changelog, should be mounteddefault: /migration/keycloak-changelog.yml
-
ADMIN_USERuser to execute migrationdefault: admin
-
ADMIN_PASSWORDpassword of user to execute migrationdefault: admin
-
ADMIN_TOTPtotp of user to execute migrationdefault: unset
-
ADMIN_CLIENTclient to use for admin logindefault: admin-cli
-
LOGIN_REALMrealm to use for admin logindefault: master
-
BASEURLBaseurl for the keycloak instancedefault: http://localhost:8080/auth
-
WAIT_FOR_KEYCLOAK(flag) If keycloakmigration should wait for the keycloak instancedefault: unset
-
WAIT_FOR_KEYCLOAK_TIMEOUTWait time till keycloak migration fails if keycloak is not ready (only ifWAIT_FOR_KEYCLOAKis set)default: 0(infinit)
-
FAIL_ON_UNDEFINED_VARIABLES(flag) If keycloakmigration should fail if undefined template variables occurdefault: unset=false
-
DISABLE_WARN_ON_UNDEFINED_VARIABLES(flag) If keycloakmigration should not warn if undefined template variables occurdefault: unset=false
-
CORRECT_HASHES(flag) If keycloakmigration should migrate not matching hashes (see Hash Troubleshooting )default: unset=false
-
STAY_IDLE(flag) Don’t kill container when migration is finished (useful for k8s deployment)default: unset=false