Skip to content
Snippets Groups Projects
Commit 8e111730 authored by Santiago Said's avatar Santiago Said
Browse files

Add option to disable autoclean

parent bb8d23c9
No related branches found
No related tags found
No related merge requests found
......@@ -21,18 +21,27 @@ function restore_db {
echo "drop database $DB_DEST"|docker-compose exec -u postgres -T db psql -U odoo -d postgres
echo "create database $DB_DEST"|docker-compose exec -u postgres -T db psql -U odoo -d postgres
gunzip -c /tmp/db.sql.gz|docker-compose exec -u postgres -T db psql -U odoo -d $DB_DEST
curl https://gitlab.eynes.com.ar/infra/eeutils/raw/master/eeutils/templates/auto_clean.sql | docker-compose exec -u postgres -T db psql -U odoo -d $DB_DEST
if ! $SKIP_AUTO_CLEAN; then
curl https://gitlab.eynes.com.ar/infra/eeutils/raw/master/eeutils/templates/auto_clean.sql | docker-compose exec -u postgres -T db psql -U odoo -d $DB_DEST
fi
}
VALID_ARGS=$(getopt -o s --long skip-aws -- "$@")
VALID_ARGS=$(getopt -o sc --long skip-aws,skip-auto-clean -- "$@")
if [[ $? -ne 0 ]]; then
exit 1;
fi
SKIP_AUTO_CLEAN=false
eval set -- "$VALID_ARGS"
while [ : ]; do
case "$1" in
-c | --skip-auto-clean)
echo "CAUTION: Autoclean will be skipped"
SKIP_AUTO_CLEAN=true
shift
;;
-s | --skip-aws)
echo "Processing from local file located in /tmp"
stop_container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment