feat(cleanup): cleaning up the project with somme standards
This commit is contained in:
24
images/airflow/scripts/create-connections.sh
Normal file
24
images/airflow/scripts/create-connections.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Simple script to provision AIRFLOW_CONNECTIONS !
|
||||
|
||||
export SQLALCHEMY_SILENCE_UBER_WARNING=1
|
||||
|
||||
conns=$(compgen -v -X '!*AIRFLOW_CONN_*')
|
||||
|
||||
for conn in ${conns}
|
||||
do
|
||||
echo "====================================="
|
||||
name="${conn#"AIRFLOW_CONN_"}"
|
||||
value=$(eval "echo -e ${!conn}")
|
||||
echo "Creating ${name}: ${value}"
|
||||
ex=$(airflow connections add "${name}" --conn-uri ${value} 2>&1)
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
echo "${conn}: Bad connection definition"
|
||||
echo "= Error =========================="
|
||||
echo "${ex}"
|
||||
echo "= End error======================="
|
||||
else
|
||||
echo "= Ok ================================"
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user