Deploy Rails app with Capistrano
- What is Capistrano
Capistrano is a framework written in Ruby language that provides automated deployment. Similar to Rake tasks in Ruby language, it runs on the remote servers via SSH. It can be configured on the local or remote server. It performs the task like copy the code from the remote repository (git..), asset precompilation, migrating the database, cron jobs, restarting the Rails server and many more.
- Why we need to deploy rail app by Capistrano
As we deploy our latest changes on the staging/production server by taking a pull of the latest code, restarting prerequisite commands like (cron, server..). This is an old school process, but now there are multiple tool or framework are available that minimize our time. Like “cap production deploy” command makes everything instead of repeating the whole process on each deployment.
There is some important key features of Capistrano:
- Manage your app code
- Installing new gem
- Restart sidekiq worker, system commands of the OS, Compile assets file and many more
- On the deployment process, if some error occurs it rollback to the previous deployment
Read more: https://tudip.com/blog-post/deploy-rails-app-with-capistrano/