Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.

Deployment

Hal Seki edited this page Oct 14, 2017 · 2 revisions

How to deploy application to production server

Normally, please push production branch to this repository. CircleCI will publish the latest production code to the production server. You can check the publish log here.

During the process, the CI will run

  • pull the latest production branch
  • bundle install
  • migrate database
  • precompile assets
  • run db:seed task
  • restart unicorn

Run rake tasks using capistrano from Docker host

If you want to run rake tasks on the server, below steps will be needed.

  1. Ask owners to add your public key to the host server.

  2. Copy your id_rsa file to (PROJECT_ROOT)/.ssh/id_rsa

cp ~/.ssh/id_rsa ./.ssh/

( ./.ssh/id_rsa is in .gitignore )

  1. Run capistrano task via docker-compose command
 docker-compose exec app bundle exec cap production deploy:graydb_import
  • The task should be written in condig/deploy.rb

Run rails related commands on the production server

  1. login to the production server

  2. move to the project directory

cd /var/www/codeforelection_front/current
  1. run run_rails_cmd.sh with commands you want to run
 ./run_rails_cmd.sh rake graydb:import

Clone this wiki locally