adding another race condition prevention
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
stevensting 2025-02-16 14:20:32 +01:00
parent 8dcb1f35e8
commit 8761f3dc6e
2 changed files with 11 additions and 9 deletions

View File

@ -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 # cannot be integrated into entrypoint.sh as it requires the operator to create a user first
function make_last_user_admin() function make_last_user_admin()

View File

@ -31,15 +31,17 @@ if [ -n "$1" ]; then
echo "Running '$1'" echo "Running '$1'"
$1 $1
else else
if [ ! -f /loomio/storage/migrations_ran ] && [ "${TASK:-}" = "worker" ]; then if [ "${TASK:-}" = "worker" ]; then
echo "first deploy, running DB setup..." if [ ! -f /loomio/storage/migrations_ran ]; then
rake db:setup echo "first deploy, running DB setup..."
touch /loomio/storage/migrations_ran rake db:setup
fi touch /loomio/storage/migrations_ran
fi
echo "running DB migrations..." echo "running DB migrations..."
rake db:migrate rake db:migrate
echo "DB migrations finished" echo "DB migrations finished"
fi
echo "starting loomio!" echo "starting loomio!"
/loomio/docker_start.sh /loomio/docker_start.sh