-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheroku_setup.sh
42 lines (25 loc) · 1.11 KB
/
heroku_setup.sh
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
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
function setupHeroku {
# remove any existing heroku remote of this repo
git remote remove heroku
local RandomNamePart
RandomNamePart=$(openssl rand -hex 8)
heroku create "airflow-$RandomNamePart"
heroku addons:create heroku-postgresql:hobby-dev
local DATABASE_CONN
DATABASE_CONN=$(heroku config:get DATABASE_URL)
heroku config:set AIRFLOW__CORE__SQL_ALCHEMY_CONN="$DATABASE_CONN"
heroku config:set AIRFLOW__CORE__LOAD_EXAMPLES=False
heroku config:set AIRFLOW_HOME=/app
local FERNET_KEY
FERNET_KEY=$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())")
heroku config:set AIRFLOW__CORE__FERNET_KEY="$FERNET_KEY"
git push heroku master
heroku run airflow upgradedb
heroku config:set AIRFLOW__WEBSERVER__AUTHENTICATE=True
heroku config:set AIRFLOW__WEBSERVER__AUTH_BACKEND=airflow.contrib.auth.backends.password_auth
heroku config:set MONGO_DB= "HERE ADD YOUR MONGO DB CONNECTION STRING"
heroku run "python initial_user_creation.py"
heroku run "rm initial_user_creation.py"
}
setupHeroku