diff --git a/.gitignore b/.gitignore index 2e5eabe28fcf8..fc1d931b80fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ dist env initdb.py logs +*.cfg MANIFEST secrets.py diff --git a/airflow/airflow.cfg b/airflow/airflow.cfg.template similarity index 100% rename from airflow/airflow.cfg rename to airflow/airflow.cfg.template diff --git a/init.sh b/init.sh index f2c3d794c653b..dbead12d94b15 100644 --- a/init.sh +++ b/init.sh @@ -2,4 +2,8 @@ source $AIRFLOW_HOME/env/bin/activate export PYTHONPATH=$AIRFLOW_HOME export AIRFLOW_CONFIG_PATH=$AIRFLOW_HOME/airflow/airflow.cfg -sed -i .bk "s#TO_REPLACE_FROM_OS_ENVIRON#$AIRFLOW_HOME#" $AIRFLOW_CONFIG_PATH + +# Create the conf file from template if it doesn't exist +if [ ! -f $AIRFLOW_CONFIG_PATH ]; then + sed "s#TO_REPLACE_FROM_OS_ENVIRON#$AIRFLOW_HOME#" ${AIRFLOW_CONFIG_PATH}.template > $AIRFLOW_CONFIG_PATH +fi