diff options
| author | EuAndreh <eu@euandre.org> | 2019-05-27 23:15:45 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2019-05-27 23:15:45 -0300 |
| commit | fe8aa0a0a1e1dd1e558685bb5c6b6ffcc387c222 (patch) | |
| tree | bc334df6ce49bee4c672ca1901415351062063f9 /provision.sh | |
| parent | Add more descriptive error message for FIXME derivation test (diff) | |
| download | server-fe8aa0a0a1e1dd1e558685bb5c6b6ffcc387c222.tar.gz server-fe8aa0a0a1e1dd1e558685bb5c6b6ffcc387c222.tar.xz | |
WIP: take a backup during deployment
Before possibly tearing down the machine, while all services are stopped (after
the =docker-compose down= command), create a new backup with the current data.
The backup tag should include the commit SHA of the deployment.
Diffstat (limited to 'provision.sh')
| -rwxr-xr-x | provision.sh | 5 |
1 files changed, 3 insertions, 2 deletions
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'..." |
