Fork of https://github.com/bigbluebutton/greenlight with Debian packaging.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 
greenlight/bin/start

37 lines
890 B

#!/bin/bash
RUBYBIN=$HOME/.gem/ruby/2.7.0/bin
NODEBIN=$PWD/node_modules/.bin
export PATH=$RUBYBIN:$NODEBIN:$PATH
export RAILS_ENV=production
export BUNDLE_APP_CONFIG=$PWD/.bundle
if ! command -v bundle >/dev/null; then
gem install --user-install bundler
fi
if ! command -v yarn >/dev/null; then
npm install yarn
fi
if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
while ! curl http://$DB_HOST:${DB_PORT:-5432}/ 2>&1 | grep '52'
do
echo "Waiting for postgres to start up ..."
sleep 1
done
fi
db_create="$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create 2>&1)"
echo $db_create
if [[ $db_create == *"already exists"* ]]; then
echo ">>> Database migration"
bundle exec rake db:migrate
else
echo ">>> Database initialization"
bundle exec rake db:schema:load
fi
bundle exec rake assets:precompile
exec bundle exec puma -C config/puma.rb