Dmitry
Dmitry

Reputation: 7563

Capistrano: multiserver deploy output is messed up

Here is an example output of 3 server deploy:

00:06 git:clone
  The repository mirror is at /home/production/site/repo
  The repository mirror is at /home/production/site/repo
  The repository mirror is at /home/production/site/repo

All lines from output are messed up and we don't know on what servers they are executed.

How can I format it to something like:

00:06 git:clone
  production@server1: The repository mirror is at /home/production/site/repo
  production@server2: The repository mirror is at /home/production/site/repo
  production@server3: The repository mirror is at /home/production/site/repo

Upvotes: 0

Views: 105

Answers (2)

Matt Brictson
Matt Brictson

Reputation: 11102

The default output of Capistrano is formatted according to the Airbrussh gem, which is aimed at making the output concise.

If you prefer more verbose output, try using the pretty formatter by adding the following line to your deploy.rb:

set :format, :pretty

That formatter will prefix each line of output with an ID that is unique to each server.

Upvotes: 3

cmramseyer
cmramseyer

Reputation: 447

Search for lib/capistrano/tasks/git.rake file in your capistrano gem folder. It have a method like this

  desc 'Clone the repo to the cache'
  task clone: :'git:wrapper' do
    on release_roles :all do
      if strategy.test
        info t(:mirror_exists, at: repo_path)
      else
        within deploy_path do
          with fetch(:git_environmental_variables) do
            strategy.clone
          end
        end
      end
    end
  end

Modify

info t(:mirror_exists, at: repo_path)

as you desired. I don't know where is the server name variable. But you are now in the right way.

Upvotes: 1

Related Questions