Skip to content

Commit

Permalink
test keycloak connection url in git CI
Browse files Browse the repository at this point in the history
  • Loading branch information
khalsz committed Feb 18, 2025
1 parent cb08c75 commit ec761d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ jobs:
pip install --upgrade pip
pip install uv
uv sync
- name: check running containers
run: docker ps -a

- name: test keycloak connection
run: curl -v http://localhost:8080
- name: Run tests
run: |
uv run pytest -rs
Expand Down
1 change: 1 addition & 0 deletions dev/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ services:
environment:
- DATABASE_HOST=pg_container
- DATABASE_PORT=5432
- KEYCLOA_HOST=keycloak
networks:
- dbnetwork

Expand Down
4 changes: 2 additions & 2 deletions src/api/environment.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import os

host = os.environ.get("DATABASE_HOST", "localhost")

keycloak_host = os.environ.get("KEYCLOA_HOST", "localhost")
# Location of the database
DB_NAME = "mast_db"
SQLALCHEMY_DATABASE_URL = f"postgresql://root:root@{host}:5432/{DB_NAME}"
# Echo SQL statements
SQLALCHEMY_DEBUG = os.environ.get("SQLALCHEMY_DEBUG", False)

# Keycloak server url
SERVER_URL = "http://keycloak:8080"
SERVER_URL = f"http://{keycloak_host}:8080"
# Realm name within keycloak
REALM_NAME = "realm1"
# Client name withing keycloak
Expand Down

0 comments on commit ec761d7

Please sign in to comment.