To accommodate Airbrussh, this commit makes the following changes:
1. Adds the airbrussh gem as a dependency
2. Bumps the sshkit dependency to 1.8.0 (for the new `use_format` method)
3. Introduces a `:format_options` setting
Out of the box, Capistrano now defaults to the following:
set :format, :airbussh
It also requires the airbrussh gem at the appropriate point in the Capistrano
boot process, which allows Airbrussh to register its `deploy:failed` hook.
We also change the default Airbrussh settings slightly, to acknowledge the fact
that Airbrussh will now be the first impression new Capistrano users have of the
tool.
Specifically:
* Enable command output (hiding the command output is tidy but probably will
confuse new users who will not know what their deploy script is doing)
* Disable the "using airbrussh format" banner at startup
Finally, this commit adds an official mechanism for sending a hash of options to
the formatter initializer. This lets users easily change Airbrussh's settings.
set :format_options, color: false, truncate: false, ...
If `:format_options` are set, Capistrano will send them to the formatter object
using SSHKit's `use_format` factory method. As of the latest SSHKit, all
formatters inheriting from `Formatter::Abstract` now accept an options hash
(although currently only Airbrussh does anything with them).
Print a warning and abort if "load:defaults" is erroneously invoked after
capistrano is already loaded, e.g. when a plugin is loaded in `deploy.rb`
instead of `Capfile`.
This change allows both the `deploy_config_path` and `stage_config_path`
to be moved from the default locations of `config/deploy.rb` and
`config/deploy` respectively. These values __must__ be set in the
`Capfile` prior to `capistrano/setup` being called, for example:
set :deploy_config_path, 'app/config/deploy.rb'
set :stage_config_path, 'app/config/deploy'
# Load DSL and Setup Up Stages
require 'capistrano/setup'
Fixes#610
Now gems can implement a 'load:defaults' task in order to set any
defaults that may rely on other varibles set in stage configuration.
namespace :load do
task :defaults do
set :my_file, release_path.join('my_file')
end
end
Any tasks specified in `~/.capfile` will be loaded when including
`capistrano/setup`. Given the default nature of these tasks, it may be
that this load order is not ideal, but for the simple use case of having
a number of default tasks available to all applications I think this is
sufficient. It would however be preferable to encourage the packaging
of shared tasks in gem format.