Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix runmigration cached using DB load and create #250

Open
wants to merge 2 commits into
base: release-4.5.X
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bin/runmigration
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#
# And finally make a database dump if none exists for current VERSION.
#
# TODO: store cache on S3 to store one DB per version
#
# Environment variables:
#
# CREATE_DB_CACHE:
Expand Down Expand Up @@ -42,6 +40,7 @@ echo $CACHE_DIR
VERSION=$(cat /odoo/VERSION)

CACHED_DUMP="$CACHE_DIR/odoo_sample_$VERSION.dmp"
NEW_CACHED_DUMP=$CACHED_DUMP

if [ "$LOAD_DB_CACHE" != "false" ]; then

Expand Down Expand Up @@ -74,9 +73,9 @@ fi
gosu odoo migrate

# Create a dump if none exist for the current VERSION
if [ "$CREATE_DB_CACHE" == "true" -a ! -f "$CACHED_DUMP" ]; then
echo "Save DB to cache $CACHED_DUMP 🐘⮕ 📦"
if [ "$CREATE_DB_CACHE" == "true" -a ! -f "$NEW_CACHED_DUMP" ]; then
echo "Save DB to cache $NEW_CACHED_DUMP 🐘⮕ 📦"
mkdir -p "$CACHE_DIR"
pg_dump -Fp -O -f "$CACHED_DUMP"
ls -l $CACHED_DUMP
pg_dump -Fp -O -f "$NEW_CACHED_DUMP"
ls -l $NEW_CACHED_DUMP
fi