This script allows to fetch a db dump from aws s3 and inject it to your actual environment (Based on your pwd)
To install widely available run:
sudo curl https://gitlab.eynes.com.ar/infra/restoredb/-/raw/master/restorerdb.sh -o /bin/restorerdb.sh && sudo chmod +x /bin/restorerdb.sh
In your bashrc or zshrc set this parameters:
export DB_DEST=devel
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
To use it go to where you have a doodba environment and do this:
BASE_URL=s3://e2-production/serivet/ ./restorerdb.sh
Reutilize existing backup in /tmp/db.sql.gz
If already downloaded the dump in /tmp/db.sql.gz use the flag -s/--skip-aws to save some time and Bandwidth
./restorerdb.sh --skip-aws
Do not run autoclean
If you need to get the database without cleaning add -c/--skip-auto-clean
./restorerdb.sh --skip-auto-clean
List available backups
docker run -e AWS_ACCESS_KEY_ID=
AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=
AWS_SECRET_ACCESS_KEY --rm -v /tmp:/tmp amazon/aws-cli s3 ls s3://e2-production/