more deployment stuff
This commit is contained in:
parent
4626152379
commit
f8fb8e6b76
2 changed files with 12 additions and 7 deletions
15
run_xexe.sh
15
run_xexe.sh
|
|
@ -21,12 +21,12 @@ has_any_step_failed=0
|
|||
cd /home/azureuser/data-xexe
|
||||
|
||||
# Update from git
|
||||
echo "Updating dbt project from git." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
git checkout master | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
git pull | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
echo "Updating xexe project from git." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
#git checkout master | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
#git pull | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
|
||||
# Activate venv
|
||||
source venv/bin/activate
|
||||
poetry shell
|
||||
|
||||
# DWH-healthcheck
|
||||
echo "Running DWH healthcheck..." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
|
|
@ -44,9 +44,14 @@ if [ $? -ne 0 ]; then
|
|||
echo "Something went wrong when healthchecking xe.com." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
fi
|
||||
|
||||
# Define some options here. You might want to change this some day.
|
||||
currencies="CAD,EUR,NZD,ZAR,AUD,USD,PLN,GBP"
|
||||
start_date=$(date -d "yesterday" +"%Y-%m-%d")
|
||||
end_date=$(date -d "yesterday" +"%Y-%m-%d")
|
||||
|
||||
# run the actual thing
|
||||
echo "Getting rates from xe.com..." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
xexe get-rates --currencies CAD,EUR,NZD,ZAR,AUD,USD,PLN,GBP --output dwh --ignore-warnings | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
xexe get-rates --currencies "$currencies" --start-date "$start_date" --end-date "$end_date" --rates-source xe --output dwh --ignore-warnings | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
has_any_step_failed=1
|
||||
echo "Something went wrong when getting rates." | while IFS= read -r line; do printf '%s %s\n' "$(date)" "$line"; done >> /home/azureuser/xexe_run.log 2>&1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue