0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EC2上でgit pullする際の流れ

0
Posted at

各種設定が済んでいる事が前提で、本番環境でgit pullする際の流れです。

cloud9上でプッシュまでします。

$ git add .
$ git commit -m "コメント"
$ git push origin ブランチ名

それからEC2にログイン

$ ssh -i ~/.ssh/practice-aws.pem ec2-user@xx.xx.xx.xx

practice-aws.pemはキーペア名、
xx.xx.xx.xxはパブリックIPアドレスを入力

EC2上でアプリケーションに移動してpull

$ cd アプリケーション名
$ git pull origin master

Gemfile更新

$ bundle install --path vendor/bundle --without test development

migrate更新

$ bundle exec rails db:migrate RAILS_ENV=production

assets更新

$ bundle exec rails assets:precompile RAILS_ENV=production

サーバー再起動

$ kill $(cat tmp/pids/puma.pid)
$ rails s -e production
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?