2018-04-23 15:29:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
cd $APP_PATH
|
2020-03-15 07:53:23 +00:00
|
|
|
|
2020-04-05 02:58:41 +00:00
|
|
|
source script/env.sh .env .env.$RAILS_ENV .env.$RAILS_ENV.local .env.local
|
2018-04-25 16:41:22 +00:00
|
|
|
|
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.
|
2020-04-08 19:25:24 +00:00
|
|
|
bundle config github.https true
|
|
|
|
bundle config set path '/var/bundle'
|
|
|
|
bundle install --jobs 8
|
2020-04-06 00:31:05 +00:00
|
|
|
|
2020-04-11 12:53:52 +00:00
|
|
|
# Precompile assets when needed. Don't assume the ENV
|
2020-04-08 19:25:24 +00:00
|
|
|
if [ "$ASSETS_PRECOMPILE" -eq 1 ]; then
|
|
|
|
echo "Fetching assets..."
|
2020-04-13 23:08:48 +00:00
|
|
|
# FIXME: disabled for now
|
2020-04-08 19:25:24 +00:00
|
|
|
if false; then
|
|
|
|
#if [[ -z "$ASSETS_PATH" ]] && [ -d "$ASSETS_PATH"]; then
|
|
|
|
rm -rf "${APP_PATH}/public/assets"
|
|
|
|
mv "$ASSETS_PATH" "${APP_PATH}/public/assets"
|
2020-04-06 00:31:05 +00:00
|
|
|
else
|
2020-04-08 19:25:24 +00:00
|
|
|
cd $APP_PATH
|
|
|
|
bundle exec rake assets:clean
|
|
|
|
bundle exec rake assets:precompile
|
2020-04-06 00:31:05 +00:00
|
|
|
fi
|
2020-04-08 19:25:24 +00:00
|
|
|
chown -R web:web $APP_PATH
|
2020-03-15 07:53:23 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-11 12:53:52 +00:00
|
|
|
# Run migrations
|
2020-04-09 01:21:50 +00:00
|
|
|
bundle exec rake db:migrate
|
2020-04-11 12:53:52 +00:00
|
|
|
|
|
|
|
# Start puma
|
2020-04-08 19:25:24 +00:00
|
|
|
bundle exec puma -C config/puma.rb
|
2020-04-11 12:53:52 +00:00
|
|
|
|
|
|
|
# After puma dies, leave us a shell
|
|
|
|
/bin/bash
|