OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/docker/prod/seeder

19 lines
490 B

#!/bin/bash -e
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
else
echo "Executing database migration and database seed..."
bundle exec rake db:migrate db:seed
fi
if [ "$1" = "--set" ]; then
shift
echo "Update application settings..."
bundle exec rake setting:set["$@"]
fi
exit 0