2018-04-23 15:29:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd /var/www
|
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-04-06 00:31:05 +00:00
|
|
|
# Make sure we have all assets
|
|
|
|
su -c "bundle config github.https true; cd $DEPLOY_PATH && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web
|
|
|
|
|
|
|
|
if [ -z $ASSETS_PRECOMPILE ] && [ $ASSETS_PRECOMPILE -eq 1 ]; then
|
|
|
|
if [[ -z "$ASSETS_PATH" ]] && [ -d "$ASSETS_PATH"]; then
|
|
|
|
rm -rf "${DEPLOY_PATH}/public/assets"
|
|
|
|
mv "$ASSETS_PATH" "${DEPLOY_PATH}/public/assets"
|
|
|
|
else
|
|
|
|
su -c "cd $DEPLOY_PATH && bundle assets:precompile" -s /bin/bash -l web
|
|
|
|
fi
|
|
|
|
chown -R web:web $DEPLOY_PATH
|
2020-03-15 07:53:23 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-06 00:31:05 +00:00
|
|
|
su -c "cd $DEPLOY_PATH && bundle exec puma -C config/puma.rb" -s /bin/bash -l web
|
2020-03-15 07:53:23 +00:00
|
|
|
bash
|