I think there are many people who have worked harder to deploy the apps they have created on AWS.
I also had a lot of trouble and succeeded in deploying on AWS.
···But!
How do you update this when you rewrite the code locally?
Of course ** Capistrano ** (I don't know anything because I haven't learned yet) It may be possible to deploy it automatically, but for the time being, I want to update it manually (?) Instead of automatically.
At first, I thought that it would be reflected if I logged in to EC2 and git pull
in the repository of the app, but it was not updated.
I looked it up, but I couldn't find the information I wanted, and I wonder if I'm the only one who has stopped for this. ?? ??
I was a little worried, but I wonder if this is somehow googled. I was able to find the information.
That was ** unicorn restart **.
$ ps -ef | grep unicorn | grep -v grep
Log in to EC2 and check the status of unicorn from the app repository.
hiroaki 6472 1 0 Aug26 ? 00:00:02 unicorn_rails master -c /var/www/rails/ride_on/config/unicorn.conf.rb -D -E production
hiroaki 7030 6472 0 Aug26 ? 00:00:10 unicorn_rails worker[1] -c /var/www/rails/ride_on/config/unicorn.conf.rb -D -E production
hiroaki 7051 6472 0 Aug26 ? 00:00:10 unicorn_rails worker[0] -c /var/www/rails/ride_on/config/unicorn.conf.rb -D -E production
If it is displayed like this, it is started, so Kill the unicorn master to stop it.
$ kill -9 6472
If you stop it, check it with this command, if there is no display, it is stopped
$ ps -ef | grep unicorn | grep -v grep
After that, start it with this command.
$ bundle exec unicorn_rails -c /var/www/rails/(app name)/config/unicorn.conf.rb -D -E production
When I checked it with this, the production environment was also updated properly ...!
I'm relieved that the update will be reflected for the time being, but I still don't understand AWS, so I'll study more ...