mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Ensure to pass on exit code from seeder if it fails
https://github.com/opf/helm-charts/issues/182
This commit is contained in:
+11
-4
@@ -3,12 +3,19 @@
|
||||
OUTPUT=$(echo "\dt" | psql `echo $DATABASE_URL | cut -d? -f1` 2>&1)
|
||||
|
||||
if [[ "$OUTPUT" = "No relations found." ]]; then
|
||||
echo "Initialising database and running seed..."
|
||||
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:structure:load db:seed
|
||||
echo "Initialising database"
|
||||
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:structure:load
|
||||
else
|
||||
echo "Executing database migration and database seed..."
|
||||
echo "Executing database migrations..."
|
||||
bundle exec rake db:migrate
|
||||
bundle exec rake db:seed
|
||||
fi
|
||||
|
||||
echo "Executing database seed..."
|
||||
bundle exec rake db:seed
|
||||
SEED_STATUS=$?
|
||||
if [ $SEED_STATUS -ne 0 ]; then
|
||||
echo "Database seed failed with status $SEED_STATUS"
|
||||
exit $SEED_STATUS
|
||||
fi
|
||||
|
||||
if [ "$1" = "--set" ]; then
|
||||
|
||||
Reference in New Issue
Block a user