-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint-apprunner.sh
More file actions
28 lines (23 loc) · 1.38 KB
/
entrypoint-apprunner.sh
File metadata and controls
28 lines (23 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -e
# ── 1. Airflow DB migration ─────────────────────────────────────────────────
echo "==> Running Airflow DB migration against external RDS..."
airflow db migrate
# ── 2. Sync FAB permissions (creates Admin/Viewer/etc roles) ─────────────────
echo "==> Syncing FAB permissions..."
airflow sync-perm
# ── 3. Create admin user (idempotent — skips if already exists) ──────────────
echo "==> Ensuring admin user exists..."
airflow users create \
--username "${AIRFLOW_ADMIN_USER:-airflow}" \
--firstname Airflow \
--lastname Admin \
--role Admin \
--email admin@example.com \
--password "${AIRFLOW_ADMIN_PASSWORD:-airflow}" || true
# ── 4. Start scheduler in background ─────────────────────────────────────────
echo "==> Starting Airflow scheduler..."
airflow scheduler &
# ── 5. Start webserver in foreground ─────────────────────────────────────────
echo "==> Starting Airflow webserver on port ${AIRFLOW__WEBSERVER__WEB_SERVER_PORT:-8080}..."
exec airflow webserver --port "${AIRFLOW__WEBSERVER__WEB_SERVER_PORT:-8080}"