1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
Commit graph

14 commits

Author SHA1 Message Date
William Johnston
44af53564b Default to Ruby 1.9 syntax. 2016-03-10 11:39:31 -06:00
William Johnston
3f6e4dbcde Enable SignalException cop 2016-03-10 08:01:53 -06:00
William Johnston
b53e550fc0 Fix Style/StringLiterals 2016-02-28 17:56:07 -06:00
William Johnston
d9a7b23257 Fix to force hash-rockets 2016-02-28 17:56:07 -06:00
Matt Brictson
dc59c248a7 Add a Plugin API
The Plugin class is a simple set of conventions for defining Capistrano plugins.
This is to support the eventual migration of SCM logic out of Capistrano itself
and into separate gems as plugins.
2016-01-17 16:46:53 -08:00
Matt Brictson
5ecd2085bd Fix broken deploy_failure.feature tests
It seems that enhancing a task using an `after` block will not have desired
effect if the new task shares the same name (excluding namespace) as the task
being enhanced. In other words, `after 'deploy:failed', :failed do ...` will
not work (the block will never be executed). This behavior was recently
introduced in 5fcf3da.

To fix the feature test using this code, I renamed the task to be a unique name.
The test now works as intended.

Also, I noticed the task defined in `fail.rake` was sometimes not working as
intended, because the `shared_path` did not exist on the VM's filesystem. This
meant that `touch` was failing. Corrected by issuing `mkdir -p` first.

With these changes, all feature tests now pass.
2015-12-27 17:00:47 -08:00
Chad Shaffer
d6f4499ee8 Address all rubocop lint warnings
* (File, Dir).exists? -> (File, Dir).exist?
* Prepend unused parameter names with an underscore
* Prefer “safe assignment in condition”
* Disambiguate splat operators with parens
* Remove unnecessary assignments (unused variables)
* No longer shadow Vagrant config variable name in Vagrantfile
* Removed some trailing whitespace

Fixes #1404
2015-08-14 14:21:34 -07:00
Lee Hambley
bb2b5f3232 Revert "Issue/1404" 2015-03-30 10:23:29 +02:00
Paul Schreiber
62246c997c fixes most of #1404
remaining:
lib/capistrano/configuration/question.rb:41:7: W: Do not suppress exceptions.
      rescue Errno::EIO
      ^^^^^^^^^^^^^^^^^
spec/support/Vagrantfile:8:47: W: Shadowing outer local variable - config.
    config.vm.define(role, primary: true) do |config|
                                              ^^^^^^
2015-03-29 22:28:21 -04:00
Nick Townsend
263295c423 Improve Cucumber tests
The test for SSH connection name switching was faulty
Improve the regexes used in the assertions
2015-02-14 11:32:45 -08:00
Nick Townsend
837eaca8b1 Copy the servers yielded to on()
This allows the SSH connection attributes to be temporarily overridden
2015-02-13 17:11:26 -08:00
Kir Shatrov
7e41233d76 Using .rake extension instead of .cap
In tests and default templates
2014-01-23 11:07:13 +04:00
seenmyfate
7432c710b0 Add hook for deploy failure
If an error is raised during a deploy, the task `deploy:failed` will be
triggered.  Custom tasks can hook into this using `after`:

    after 'deploy:failed', :send_for_help do
      #
    end

I've also taken the opportunity to provide a marginally more useful
error message before triggering the task.

By default, this 'deploy:failed' will only be triggered when running
`cap <stage> deploy` - to trigger after individual tasks use `set
:deploying, true`

This closes #708 and replaces
https://github.com/capistrano/capistrano/pull/720
2013-11-01 12:24:36 +00:00
seenmyfate
ba0d313440 Remote file task
The commit introduces a `remote_file` task, allowing the existence of a remote
file to be set as a prerequisite.  These tasks can in turn depend on local
files if required. In this implementation, the fact that we're dealing with a
file in the shared path is assumed.

As as example, this task can be used to ensure that files to be linked exist
before running the `check:linked_files` task:

      namespace :deploy do
        namespace :check do
          task :linked_files => 'config/newrelic.yml'
        end
      end

      remote_file 'config/newrelic.yml' => '/tmp/newrelic.yml', roles: :app

      file '/tmp/newrelic.yml' do |t|
        sh "curl -o #{t.name} https://rpm.newrelic.com/accounts/xx/newrelic.yml"
      end
2013-08-16 17:01:50 +01:00