Skip to content
This repository was archived by the owner on Aug 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/rails.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ fi

cd $dir

check_bundler
using_bundler=check_bundler
if [ "$?" == "0" ]; then
echo " => Installing missing gems..."
sudo RAILS_ENV=production rake gems:install > $LOG_DIR/gems_install.log 2>&1
check_error 'installing gems' 'gems_install'
fi

echo " => Migrating database..."
RAILS_ENV=production rake db:migrate > $LOG_DIR/db_migrate.log 2>&1
if [[ $using_bundler == 1 ]]; then
RAILS_ENV=production bundle exec rake db:migrate > $LOG_DIR/db_migrate.log 2>&1
else
RAILS_ENV=production rake db:migrate > $LOG_DIR/db_migrate.log 2>&1
fi
check_error 'migrating database' 'db_migrate'

sudo chown -R git:www-data * > $LOG_DIR/chown.log 2>&1
Expand Down
4 changes: 2 additions & 2 deletions scripts/rails3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ if [ $? -eq 1 ]; then
fi

echo " => Migrating database..."
RAILS_ENV=production rake db:migrate > $LOG_DIR/db_migrate.log 2>&1
RAILS_ENV=production bundle exec rake db:migrate > $LOG_DIR/db_migrate.log 2>&1
check_error 'migrating database' 'db_migrate'

sudo chown -R git:www-data * > $LOG_DIR/chown.log 2>&1
cd -

restart_webserver $already_existed
restart_webserver $already_existed