2024-02-06 12:09:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
cd /home/azureuser/data-dwh-dbt-project
|
|
|
|
|
|
|
|
|
|
# Update from git
|
|
|
|
|
echo "Updating dbt project from git." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
2024-03-06 12:07:51 +01:00
|
|
|
git checkout master | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
2024-02-06 12:09:47 +01:00
|
|
|
git pull | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
|
|
|
|
|
# Activate venv
|
|
|
|
|
source venv/bin/activate
|
|
|
|
|
|
2024-03-06 12:07:51 +01:00
|
|
|
# Run seeds
|
|
|
|
|
echo "Triggering dbt seed" | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
dbt seed | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
|
2024-05-10 00:31:27 +02:00
|
|
|
# Run staging layer
|
|
|
|
|
echo "Triggering dbt run: Staging" | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
dbt run -s models/staging | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
|
|
|
|
|
# Run intermediate layer
|
|
|
|
|
echo "Triggering dbt run: Intermediate" | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
dbt run -s models/intermediate | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
|
|
|
|
|
# Run reporting layer
|
|
|
|
|
echo "Triggering dbt run: Reporting" | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|
|
|
|
|
dbt run -s models/reporting | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/dbt_run.log 2>&1
|