First, in your project, you need to install Capistrano 3 for Rails. You can find the official documentation here. So your Gemfile...

...should have content along these lines somewhere: group :development do gem 'capistrano', require: false gem 'capistrano-rails', require: false end You should already have the bundler Gem installed, so you...

As it's possible that you manage the Ruby version by yourself we created the capistrano-opscomplete Gem to support you with this task. As before, add the Gem to...

gem 'capistrano-opscomplete', require: false And again, actually install it by calling bundle: $ bundle Now make the tasks the Gem provides available to you during deploy by adding...

opscomplete

...directory will look something like this: . ├── Capfile ├── config │ ├── deploy │ │ ├── production.rb │ │ └── staging.rb │ └── deploy.rb ├── Gemfile └── lib └── capistrano └── tasks Starting from there, we at makandra use the following changes to the config/deploy.rb file...

...need for a default rails application the following additions to your Capfile: # Capfile require 'capistrano/bundler' require 'capistrano/rails/assets' require 'capistrano/rails/migrations...

opscomplete

...use Puma as the application server you have the two following options. There is the capistrano-puma gem. There is no stable support for the latest puma-6 version yet...

...The capistrano-opscomplete gem in version 1.1.0 and higher has support to reload your application after deployment. We recommend to use this as it is a simple and performant integration...

...the application servers, to automatically restart passenger workers after a deploy you should include the capistrano-passenger Gem in your Gemfile by adding this line: gem 'capistrano-passenger', require: false...

# This automatically sets up deploy:restart to run after :publishing is complete require 'capistrano/passenger' As the comment says, just the presence of this line automatically calls deploy:restart and...

Here is an example configuration for using Sidekiq with our Procfile support and Capistrano. Sidekiq specific steps in lib/capistrano/tasks/sidekiq.rake. Please make sure the roles meet your needs: # frozen_string_literal...

From the previous card about the deployment structure we now want to set up Capistrano 3. In the following Cards...

...we are describing an opinionated set up in this card. Install Capistrano Configure Capistrano Install capistrano-passenger Install capistrano-opscomplete Not using Git? Should you not be using Git, Capistrano...

opscomplete

...file named Procfile in your repository to be used by supervisord. This works best with capistrano-opscomplete. If you want to use this feature, please contact ops@makandra.de so we can...

...also need to setup the the tasks for the deployment. If you're already using capistrano-opscomplete, you can add these lines to your Capistrano config: # Update and Restart supervisor...

...have to take care of the installation and configuration of the ruby versions yourself. Our capistrano-opscomplete gem can install the ruby version automatically on deploy for you. You can...

...learn how to setup this in our Capistrano documentation. Ruby YJIT The Ruby versions 3.1+ we install include YJIT. If your application requires the RUBY_YJIT_ENABLE=1 environment variable...

opscomplete

...important directories. The directories you find in your deployment dirs are based on the Capistrano Directory Structure. The following shows a freshly deployed directory structure: root@server:/var/www/www.acme.com# tree -d...

...directory is a symlink that always points to the last successful deployment done by capistrano. In 201 Capistrano 3 for your makandra Deployment you will find a guide on how...

opscomplete

...without need to ask Makandra Operations for each individual change. If you are using Capistrano you have to check your Ruby version (>=2 and >=net-ssh-4.1) and which encryption...

Best results in other decks

wiki

...your Gemfile next lines into development group: gem 'oz_capistrano_rsync_with_remote_cache' gem 'capistrano-deploy-scm-passthrough' and change deploy.rb like this: require 'rvm/capistrano' require 'bundler/capistrano' set :application...

When deploying, Capistrano puts a REVISION file into your application's release directory. It contains the hash of the commit which was deployed. If you want to know the currently...

...deployed release, simply SSH to a server and view that file. $ cat /var/www/my-project/current/REVISION cf8734ece3938fc67262ad5e0d4336f820689307 Capistrano task When your application is deployed to multiple servers, you probably want to see a...

Search in all decks