-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳 [#80] Set up infra + test for live integration test
- Loading branch information
1 parent
e8b216d
commit b641a81
Showing
10 changed files
with
2,122 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Config taken from https://stackoverflow.com/a/77257732 | ||
# | ||
# This docker-compose is for development and test purposes. Tests are recorded with | ||
# VCR against this instance. | ||
# | ||
# Log in to http://localhost:8080/admin/master/console/ with `admin`/`admin` | ||
# credentials. | ||
# | ||
# DO NOT USE THIS IN PRODUCTION. | ||
# | ||
|
||
version: '3.8' | ||
|
||
services: | ||
keycloak: | ||
image: quay.io/keycloak/keycloak:23.0.6 | ||
command: start-dev --import-realm | ||
environment: | ||
- KEYCLOAK_ADMIN=admin | ||
- KEYCLOAK_ADMIN_PASSWORD=admin | ||
volumes: | ||
- ./docker/import:/opt/keycloak/data/import | ||
ports: | ||
- 8080:8080 |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Keycloak Realm export and import | ||
|
||
The `import/realm.json` is loaded when the Keycloak service is spun up through | ||
docker-compose. In the top-level directory: | ||
|
||
```bash | ||
docker-compose up -d | ||
``` | ||
|
||
You can now log in via `http://localhost:8080` with the `admin`/`admin` credentials. | ||
|
||
## Exporting the Realm | ||
|
||
In short - exporting through the admin UI (rightfully) obfuscates client secrets and | ||
user credentials. However, for reproducible builds/environments, we want to include | ||
this data in the Realm export. | ||
|
||
Ensure the service is up and running through docker-compose. | ||
|
||
Ensure that UID `1000` can write to `./docker/import/`: | ||
|
||
```bash | ||
chmod o+rwx ./docker/import/ | ||
``` | ||
|
||
Then open another terminal and run: | ||
|
||
```bash | ||
docker-compose exec keycloak ./bin/kc.sh \ | ||
export \ | ||
--file /opt/keycloak/data/import/test-realm.json \ | ||
--realm test | ||
``` |
Oops, something went wrong.