Compare commits

7 Commits

Author SHA1 Message Date
8edaaee117 Update workflow.yml
Some checks failed
Build, Push and Update Image in Manifest / build-and-update (push) Has been cancelled
2025-10-02 15:39:01 +02:00
github-actions[bot]
4cb09bb053 fix(infrastructure): alembic - use SSL for DB connection 2025-10-02 13:10:59 +00:00
dd0ca4b4f1 fix(infrastructure): alembic - use SSL for DB connection 2025-10-02 15:10:09 +02:00
github-actions[bot]
42f3d4dae1 Merge pull request #1 from dat515-2025/merge/refactor_migrations
Some checks failed
Build, Push and Update Image in Manifest / build-and-update (push) Has been cancelled
refactor(backend): refactor project, add database migrations support
2025-09-30 11:08:31 +00:00
57d8f169da Merge pull request #1 from dat515-2025/merge/refactor_migrations
refactor(backend): refactor project, add database migrations support
2025-09-30 13:07:41 +02:00
8a718d6f59 move design 2025-09-29 12:08:45 +02:00
9dba6179e1 Update design to trigger quickfeed 2025-09-26 14:00:21 +02:00
5 changed files with 7 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ on:
jobs: jobs:
build-and-update: build-and-update:
runs-on: ubuntu-latest runs-on: kbctl
permissions: permissions:
contents: write contents: write
packages: write packages: write

View File

@@ -169,6 +169,7 @@ flowchart TB
planner --> queue planner --> queue
worker --> db worker --> db
``` ```
- Configuration & secrets: Env vars, secret manager, .env files (never commit secrets). - Configuration & secrets: Env vars, secret manager, .env files (never commit secrets).

View File

@@ -23,9 +23,10 @@ if not DATABASE_URL:
mariadb_password = os.getenv("MARIADB_PASSWORD", "strongpassword") mariadb_password = os.getenv("MARIADB_PASSWORD", "strongpassword")
DATABASE_URL = f"mysql+pymysql://{mariadb_user}:{mariadb_password}@{mariadb_host}:{mariadb_port}/{mariadb_db}" DATABASE_URL = f"mysql+pymysql://{mariadb_user}:{mariadb_password}@{mariadb_host}:{mariadb_port}/{mariadb_db}"
# Use synchronous driver for Alembic migrations
SYNC_DATABASE_URL = DATABASE_URL.replace("+asyncmy", "+pymysql") SYNC_DATABASE_URL = DATABASE_URL.replace("+asyncmy", "+pymysql")
ssl_enabled = os.getenv("MARIADB_HOST", "localhost") != "localhost"
connect_args = {"ssl": {"ssl": True}} if ssl_enabled else {}
def run_migrations_offline() -> None: def run_migrations_offline() -> None:
context.configure( context.configure(
@@ -39,7 +40,7 @@ def run_migrations_offline() -> None:
def run_migrations_online() -> None: def run_migrations_online() -> None:
connectable = create_engine(SYNC_DATABASE_URL, poolclass=pool.NullPool) connectable = create_engine(SYNC_DATABASE_URL, poolclass=pool.NullPool, connect_args=connect_args)
with connectable.connect() as connection: with connectable.connect() as connection:
context.configure( context.configure(
connection=connection, connection=connection,

View File

@@ -14,7 +14,7 @@ spec:
app: app-demo app: app-demo
spec: spec:
containers: containers:
- image: lukastrkan/cc-app-demo@sha256:84cbe8181c87c32579b00e44d9c15e2db6d4a5c1e73577e517832b76bf337c59 - image: lukastrkan/cc-app-demo@sha256:75634b4d97282b6b8424fe17767c81adf44af5f7359c1d25883073b5629b3e05
name: app-demo name: app-demo
ports: ports:
- containerPort: 8000 - containerPort: 8000

View File

@@ -14,7 +14,7 @@ spec:
app: app-demo-worker app: app-demo-worker
spec: spec:
containers: containers:
- image: lukastrkan/cc-app-demo@sha256:84cbe8181c87c32579b00e44d9c15e2db6d4a5c1e73577e517832b76bf337c59 - image: lukastrkan/cc-app-demo@sha256:75634b4d97282b6b8424fe17767c81adf44af5f7359c1d25883073b5629b3e05
name: app-demo-worker name: app-demo-worker
command: command:
- python3 - python3