adding AWS - database backup/restore
The Problem/Issue/Bug
It's not possible to maintain consistent database across workspaces.
How this PR Solves The Problem
Add AWS commands:
.gitpod/aws/aws-backup.sh [backup_name]
.gitpod/aws/aws-restore.sh [backup_name]
Manual Testing Instructions
- Create new Gitpod Environment variables through CLI (or directly in https://gitpod.io/variables)
gp env AWS_ACCESS_KEY_ID=[ID]gp env AWS_SECRET_ACCESS_KEY=[SECRET]gp env AWS_DEFAULT_BUCKET=[BUCKET_NAME] - open a new workspace (or stop/start current workspace, for
gp envto take effect) - Make some changes in current website.
- Run
aws-backup.sh testing123(for a named backup) - Make additional changes in current website.
- Run
aws-backup.sh(for general backup, to be used later in Gitpod's future end-tasks) - Close workspace
- Open a new workspace
- Run
aws-restore.sh testing123(for restoring the named backup) - Confirm first changes are in the website, after its DB was restored.
- Run
aws-restore.sh(for restoring the latest backup available) - Confirm second changes are in the website, after its DB was restored.
Related Issue Link(s)
Release/Deployment notes
Elegant - the first word that came to mind 😄.
I'd love for this to be part of the new Gitpod Guides section we're working on (https://github.com/gitpod-io/website/issues/709) 🎉.
One interesting thought would be to add a docker volume plugin like https://github.com/muthu-r/horcrux - that would allow saving and restoring snapshots directly from S3 or minio. I haven't tried it. And that plugin doesn't look active.
On second thought, although that is recommended in https://docs.docker.com/engine/extend/legacy_plugins/ ... it doesn't actually look like it's ever had any activity in issues or PRs or anything.