diff --git a/resources/examples/airflow/up.sh b/resources/examples/airflow/up.sh index 9132db4706e6d..7f839ce8a246d 100755 --- a/resources/examples/airflow/up.sh +++ b/resources/examples/airflow/up.sh @@ -1,14 +1,32 @@ #!/usr/bin/env bash -cd ../../.. -echo "Attempting to remove previous Airbyte installation..." -docker-compose down -v -docker-compose up -d -cd resources/examples/airflow || exit -echo "Attempting to remove previous Airflow installation..." -docker-compose -f docker-compose-airflow.yaml down -v -docker-compose -f docker-compose-airflow.yaml up -d -# Create Postgres Database to replicate to. -docker run --rm --name airbyte-destination -e POSTGRES_PASSWORD=password -p 2000:5432 -d postgres +trap 'kill $ABID; kill $AFID; kill $SSID; kill $PGID; exit' INT +( + cd ../../.. + echo "Starting Airbyte..." + docker-compose down -v + docker-compose up -d +)& +ABID=$! +( + echo "Starting Airflow..." + docker-compose -f docker-compose-airflow.yaml down -v + docker-compose -f docker-compose-airflow.yaml up -d +)& +AFID=$! +( + echo "Starting Superset..." + docker-compose -f superset/docker-compose-superset.yaml down -v + docker-compose -f superset/docker-compose-superset.yaml up -d +)& +SSID=$! +( + echo "Creating PG destination (localhost:2000 postgres/password)" + docker rm --force airbyte-destination + docker run --rm --name airbyte-destination -e POSTGRES_PASSWORD=password -p 2000:5432 -d postgres +)& +PGID=$! +echo "Waiting for applications to start..." +wait echo "Access Airbyte at http://localhost:8000 and set up a connection." echo "Enter your Airbyte connection ID: " read connection_id @@ -16,7 +34,4 @@ read connection_id docker exec -ti airflow_webserver airflow variables set 'AIRBYTE_CONNECTION_ID' "$connection_id" docker exec -ti airflow_webserver airflow connections add 'airbyte_example' --conn-uri 'airbyte://host.docker.internal:8000' echo "Access Airflow at http://localhost:8085 to kick off your Airbyte sync DAG." -echo "Attempting to remove previous Superset installation." -docker-compose -f superset/docker-compose-superset.yaml down -v -docker-compose -f superset/docker-compose-superset.yaml up -d echo "Access Superset at http://localhost:8088 to set up your dashboards." \ No newline at end of file