#!/bin/bash -l set -e SCRIPT_PATH=$(dirname $(readlink -f $0)) . $SCRIPT_PATH/post-receive-utils.sh deploy source $HOME/.bashrc # source /etc/profile cd $DEPLOY_DIR/current title 'deploy - bundle install' if [ "$BUNDLE_PATH" = "" ]; then BUNDLE_PATH="vendor/bundle/" fi RAILS_ENV=$PROJECT_ENVIRONMENT $HOME/.rbenv/bin/rbenv exec bundle check --path $BUNDLE_PATH || RAILS_ENV=$PROJECT_ENVIRONMENT $HOME/.rbenv/bin/rbenv exec bundle install --path $BUNDLE_PATH --jobs 4 --without development test --deployment --quiet 2>&1 | indent if [ "$PRECOMPILE_ASSETS" != "false" ]; then title 'deploy - precompile assets' RAILS_ENV=$PROJECT_ENVIRONMENT $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile 2>&1 | indent fi if [ "$ACTIVE_RECORD" != "false" ]; then title 'deploy - migrations' RAILS_ENV=$PROJECT_ENVIRONMENT $HOME/.rbenv/bin/rbenv exec bundle exec rake db:migrate 2>&1 | indent fi restart_application post_startup