Subham9126 commited on
Commit
49f36ae
·
verified ·
1 Parent(s): 27c3627

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +21 -0
entrypoint.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # 1. Clone your DAGs repository
4
+ # Replace with your repo URL. Use a Personal Access Token (PAT) if private.
5
+ echo "Syncing DAGs from GitHub..."
6
+ git clone $GIT_REPO_URL /opt/airflow/dags
7
+
8
+ # 2. Initialize or Migrate the External DB
9
+ airflow db migrate
10
+
11
+ # 3. Create Admin User (Optional: only needed if not already in DB)
12
+ airflow users create \
13
+ --username "$ADMIN_USER" \
14
+ --password "$ADMIN_PASSWORD" \
15
+ --firstname Admin \
16
+ --lastname User \
17
+ --role Admin \
18
+ --email admin@example.com || true
19
+
20
+ # 4. Start Scheduler and Webserver
21
+ airflow scheduler & airflow webserver