ensl.org/bin/script/entry.sh

39 lines
923 B
Bash
Raw Normal View History

#!/bin/bash
cd $APP_PATH
source script/env.sh .env .env.$RAILS_ENV .env.$RAILS_ENV.local .env.local
2020-05-03 10:25:14 +00:00
# Create dirs
mkdir -p tmp/pids tmp/sockets tmp/sessions tmp/cache log
2020-04-11 12:53:52 +00:00
# Make sure we have all gems, this fixed some startup issues.
bundle config github.https true
bundle config set path '/var/bundle'
bundle install --jobs 8
2020-04-11 12:53:52 +00:00
# Precompile assets when needed. Don't assume the ENV
if [ "$ASSETS_PRECOMPILE" -eq 1 ]; then
echo "Fetching assets..."
2020-04-13 23:08:48 +00:00
# FIXME: disabled for now
if false; then
#if [[ -z "$ASSETS_PATH" ]] && [ -d "$ASSETS_PATH"]; then
rm -rf "${APP_PATH}/public/assets"
mv "$ASSETS_PATH" "${APP_PATH}/public/assets"
else
cd $APP_PATH
bundle exec rake assets:clean
bundle exec rake assets:precompile
fi
chown -R web:web $APP_PATH
fi
2020-04-11 12:53:52 +00:00
# Run migrations
bundle exec rake db:migrate
2020-04-11 12:53:52 +00:00
# Start puma
bundle exec puma -C config/puma.rb
2020-04-11 12:53:52 +00:00
# After puma dies, leave us a shell
/bin/bash