diff options
| -rwxr-xr-x | backup-and-shutdown.sh | 8 | ||||
| -rwxr-xr-x | provision.sh | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/backup-and-shutdown.sh b/backup-and-shutdown.sh new file mode 100755 index 0000000..c880a16 --- /dev/null +++ b/backup-and-shutdown.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +echo "FIXME: get current backup" +echo docker-compose down +echo "FIXME: create a new backup" +echo "FIXME: rsync back new backup" diff --git a/provision.sh b/provision.sh index cf8c2d3..42e7990 100755 --- a/provision.sh +++ b/provision.sh @@ -4,8 +4,9 @@ set -Eeuo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" -echo "Shutting down running containers..." -ssh "$TLD" "cd /home/vps/ && docker-compose down" +echo "Shutting down running containers and backing up data..." +envsubst < backup-and-shutdown.sh | ssh "$TLD" 'cat > /home/vps/backup-and-shutdown.sh' +ssh "$TLD" /home/vps/backup-and-shutdown.sh echo "Done." echo "Running 'terraform apply'..." |
