Skip to content

Commit

Permalink
chore(scalingo): clean up entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vmttn committed Oct 23, 2023
1 parent 89b4795 commit 641a529
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions pipeline/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ COMMAND=$1
# scheme `postgres://`. Therefore it is replaced.
export AIRFLOW__DATABASE__SQL_ALCHEMY_CONN="${DATABASE_URL/postgres\:\/\//postgresql\:\/\/}"

if [[ "${COMMAND}" = "webserver" ]]; then
export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.basic_auth
export AIRFLOW_HOME=./airflow
export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.basic_auth
export AIRFLOW__CORE__LOAD_DEFAULT_CONNECTIONS=False
export AIRFLOW__CORE__LOAD_EXAMPLES=False
export AIRFLOW__CORE__EXECUTOR=LocalExecutor
export AIRFLOW__CORE__DEFAULT_TIMEZONE=Europe/Paris
export AIRFLOW__CORE__FERNET_KEY="${SECRET_KEY}"
export AIRFLOW__CORE__DAGS_FOLDER=./dags

if [[ "${COMMAND}" = "webserver" ]]; then
airflow webserver --port "${PORT}"
fi

Expand Down Expand Up @@ -50,14 +57,5 @@ if [[ "${COMMAND}" = "scheduler" ]]; then
# Install dbt packages (not python packages)
"${VIRTUAL_ENV}/bin/dbt" deps --project-dir "${AIRFLOW_VAR_DBT_PROJECT_DIR}"

export AIRFLOW_HOME=./airflow
export AIRFLOW__DATABASE__SQL_ALCHEMY_CONN="${DATABASE_URL/postgres\:\/\//postgresql\:\/\/}"
export AIRFLOW__CORE__LOAD_DEFAULT_CONNECTIONS=False
export AIRFLOW__CORE__LOAD_EXAMPLES=False
export AIRFLOW__CORE__EXECUTOR=LocalExecutor
export AIRFLOW__CORE__DEFAULT_TIMEZONE=Europe/Paris
export AIRFLOW__CORE__FERNET_KEY="${SECRET_KEY}"
export AIRFLOW__CORE__DAGS_FOLDER=./dags

airflow scheduler
fi

0 comments on commit 641a529

Please sign in to comment.