From 8761f3dc6eeb5a6c3c61a819a789009ddb8effb6 Mon Sep 17 00:00:00 2001 From: stevensting Date: Sun, 16 Feb 2025 14:20:32 +0100 Subject: [PATCH] adding another race condition prevention --- abra.sh | 2 +- entrypoint.sh | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/abra.sh b/abra.sh index 47f3c79..8ac92b1 100644 --- a/abra.sh +++ b/abra.sh @@ -1,4 +1,4 @@ -export LOOMIO_ENTRYPOINT_VERSION=v5 +export LOOMIO_ENTRYPOINT_VERSION=v6 # cannot be integrated into entrypoint.sh as it requires the operator to create a user first function make_last_user_admin() diff --git a/entrypoint.sh b/entrypoint.sh index b6436e5..449c73a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,15 +31,17 @@ if [ -n "$1" ]; then echo "Running '$1'" $1 else - if [ ! -f /loomio/storage/migrations_ran ] && [ "${TASK:-}" = "worker" ]; then - echo "first deploy, running DB setup..." - rake db:setup - touch /loomio/storage/migrations_ran - fi + if [ "${TASK:-}" = "worker" ]; then + if [ ! -f /loomio/storage/migrations_ran ]; then + echo "first deploy, running DB setup..." + rake db:setup + touch /loomio/storage/migrations_ran + fi - echo "running DB migrations..." - rake db:migrate - echo "DB migrations finished" + echo "running DB migrations..." + rake db:migrate + echo "DB migrations finished" + fi echo "starting loomio!" /loomio/docker_start.sh