はじめに
備忘録です。
デプロイで使うコマンド
前提条件として、
AWS EC2環境/var/www/app/
配下でgit cloneさせます。
git clone
言わずもがなgit cloneです。
git pull
言わずもがなgit pullです。
bundle install
bundle install --path=vendor/bundle --without development test
assets precompile
bundle exec rails assets:precompile RAILS_ENV=staging
migrate
bundle exec rails db:migrate RAILS_ENV=staging
rails server起動
bundle exec rails s -e staging -d
rails server停止
ps aux | grep rails (rails s -e staging -d のプロセスidを見つける)
kill プロセスid
rails コンソール
bundle exec rails c -e staging
ちなみに
上記はstaging環境でのコマンドとなります。
production環境の場合、staging
を**production
**に変更すればOK。