Skip to content

Commit

Permalink
Merge pull request #3031 from SEED-platform/fix-backup-filename
Browse files Browse the repository at this point in the history
Fix k8s backup filename
  • Loading branch information
nllong committed Dec 13, 2021
2 parents 0777831 + 51e371e commit 519f2fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docker/backup_k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# script that is copied into this container for use by helm/k8s batch/CronJob.

# docker build -t seedplatform/seed-backup-k8s .
# docker push seedplatform/seed-backup-k8s:latest
# tag this as needed, latest is automaticallly pulled by helm at the moment.
# docker tag seedplatform/seed-backup-k8s:latest seedplatform/seed-backup-k8s:{tag}
# docker push seedplatform/seed-backup-k8s:{tag}

FROM ubuntu:20.04

Expand Down
10 changes: 6 additions & 4 deletions docker/backup_k8s/backup_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ do
echo "Backing up $file to $S3_BUCKET/$RUN_DATE/"
if [ ! -s $file ]; then
# the file is empty, send an error
send_slack_notification "[ERROR-$ENVIRONMENT]-PostgreSQL-backup-file-was-empty"
send_slack_notification "[ERROR-$ENVIRONMENT]-PostgreSQL-backup-file-was-empty-or-missing"
else
# can't pass spaces to slack notifications, for now
aws s3 cp $file $S3_BUCKET/$RUN_DATE/
send_slack_notification "[$ENVIRONMENT]-PostgreSQL-uploaded-to-s3://$S3_BUCKET/$RUN_DATE/$file"
send_slack_notification "[$ENVIRONMENT]-PostgreSQL-uploaded-to-$S3_BUCKET/$RUN_DATE/$(basename $file)"
fi
done

Expand All @@ -103,10 +104,11 @@ do

if [ ! -s $file ]; then
# the file is empty, send an error
send_slack_notification "[ERROR-$ENVIRONMENT]-Mediadata-backup-file-was-empty"
send_slack_notification "[ERROR-$ENVIRONMENT]-Mediadata-backup-file-was-empty-or-missing"
else
# can't pass spaces to slack notifications, for now
aws s3 cp $file $S3_BUCKET/$RUN_DATE/
send_slack_notification "[$ENVIRONMENT]-Mediadata-uploaded-to-s3://$S3_BUCKET/$RUN_DATE/$file"
send_slack_notification "[$ENVIRONMENT]-Mediadata-uploaded-to-$S3_BUCKET/$RUN_DATE/$(basename $file)"
fi
done

Expand Down

0 comments on commit 519f2fc

Please sign in to comment.