Created
October 12, 2019 17:30
-
-
Save danielchalef/4fa408b2bcdc0624ceb920cb008fd58f to your computer and use it in GitHub Desktop.
Clean up airflow dev environment and restart webserver/scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$AIRFLOW_HOME" ] | |
then | |
echo "AIRFLOW_HOME is not set" | |
exit 1 | |
fi | |
if [ -f "$AIRFLOW_HOME/airflow-webserver.pid" ] | |
then | |
ps au | grep airflow | awk '{ print $2 }' | xargs kill 2> /dev/null | |
fi | |
AIRFLOW_DB=$AIRFLOW_HOME/airflow.db | |
if [ -f "$AIRFLOW_DB" ] | |
then | |
rm $AIRFLOW_HOME/airflow.db | |
fi | |
rm -rf $AIRFLOW_HOME/logs/* | |
airflow initdb | |
airflow webserver -p 8080 &>> $AIRFLOW_HOME/run.log & | |
airflow scheduler &>> $AIRFLOW_HOME/run.log & | |
sleep 5 | |
airflow variables -i $AIRFLOW_HOME/variables.json | |
airflow connections -d --conn_id aws_default && \ | |
airflow connections -a --conn_id aws_default --conn_type aws --conn_extra '{ "region_name": "us-west-2" }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment