diff --git a/ixc_django_docker/bin/npm-install.sh b/ixc_django_docker/bin/npm-install.sh index 3e14441..27da46c 100755 --- a/ixc_django_docker/bin/npm-install.sh +++ b/ixc_django_docker/bin/npm-install.sh @@ -21,11 +21,10 @@ if [[ ! -s package.json ]]; then EOF fi -UNAME="$(uname)" +md5file=package.json.md5.$(uname) -touch "package.json.md5.$UNAME" - -if [[ ! -s "package.json.md5.$UNAME" ]] || ! md5sum --status -c "package.json.md5.$UNAME" > /dev/null 2>&1; then +[[ -s "$md5file" ]] && md5sum --status -c "$md5file" > /dev/null 2>&1 \ +|| { echo "Node modules in '$DIR' directory are out of date, 'package.json' has been updated." if [[ -d node_modules && -z ${NPM_INSTALL_SH_SKIP_CLEAN+1} ]]; then rm -rf node_modules/* @@ -38,5 +37,5 @@ if [[ ! -s "package.json.md5.$UNAME" ]] || ! md5sum --status -c "package.json.md npm install --unsafe-perm fi rm -f package.json.md5.* # 'node_modules' is shared, if we rebuild for one platform, other platforms become invalid - md5sum package.json > "package.json.md5.$UNAME" -fi + md5sum package.json > "$md5file" + } diff --git a/ixc_django_docker/bin/setup-postgres.sh b/ixc_django_docker/bin/setup-postgres.sh index 40caa24..a6e5c84 100755 --- a/ixc_django_docker/bin/setup-postgres.sh +++ b/ixc_django_docker/bin/setup-postgres.sh @@ -58,6 +58,11 @@ if [[ "$SRC_PGDATABASE" == *.sql ]]; then echo "Restore to database '$PGDATABASE' from file '$SRC_PGDATABASE'." pv "$SRC_PGDATABASE" | psql -d "$PGDATABASE" > /dev/null fi +elif [[ "$SRC_PGDATABASE" == *.sql.gz ]]; then + if [[ -f "$SRC_PGDATABASE" ]]; then + echo "Restore to database '$PGDATABASE' from file '$SRC_PGDATABASE'." + pv "$SRC_PGDATABASE" | gunzip | psql -d "$PGDATABASE" > /dev/null + fi elif [[ -n "$SRC_PGDATABASE" ]]; then # Get source database credentials. SRC_PGHOST="${SRC_PGHOST:-${PGHOST}}" diff --git a/ixc_django_docker/celery/tasks.py b/ixc_django_docker/celery/tasks.py index 3817886..0d73eca 100644 --- a/ixc_django_docker/celery/tasks.py +++ b/ixc_django_docker/celery/tasks.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -from celery.task import task +from .celery import app from django.core import management import decorator import redis_lock @@ -49,7 +49,7 @@ def skip_concurrent(f, lock_kwargs=None, *args, **kwargs): return 'Skipped. Unable to acquire lock: %s' % name -@task +@app.task @skip_concurrent def call_command(*args, **kwargs): return management.call_command(*args, **kwargs)