Steps:
- Put your SQL script into the sql directory
- Create a GCS bucket which will be watched
- In main.py chagne the TARGET_DATASET and TARGET_TABLE
- Change and define the set-env-vars environmental variables
- Deploy the Cloud Functions code with the following command:
gcloud functions deploy run_sql_scripts --trigger-resource [bucket] --set-env-vars DATASET=test --runtime python37 --timeout=540s --region=europe-west1 --trigger-event google.storage.object.finalize
- Google Cloud Storage Triggers