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

30 commits

Author SHA1 Message Date
Lee Hambley
5e266d56e2 Merge pull request #1617 from will-in-wi/rubocop_special_global_vars
Enable SpecialGlobalVars cop
2016-03-07 13:12:36 +01:00
Matt Brictson
f90f9a03f5 Use %Q instead of bare % for string literals 2016-03-01 20:13:57 -08:00
William Johnston
a22b5865fb Add english require to affected files. 2016-03-01 09:51:47 -06:00
William Johnston
5f8e7c2cc9 Enable SpecialGlobalVars cop 2016-03-01 09:36:05 -06:00
William Johnston
9dc9462d04 Fix Style/SpaceAroundBlockParameters 2016-02-28 17:56:07 -06:00
William Johnston
dc2cbace0b Fix Style/EmptyLinesAroundModuleBody 2016-02-28 17:56:07 -06:00
William Johnston
06621f2ea7 Fix Style/TrailingBlankLines 2016-02-28 17:56:07 -06:00
William Johnston
b53e550fc0 Fix Style/StringLiterals 2016-02-28 17:56:07 -06: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
Sergey Ponomarev
859eec68c6 Fix cucumber spec for loading tasks from stage configs 2014-12-10 01:13:19 +03:00
Lee Hambley
f6af81c405 Fix rspec assertion be_false != be_falsey 2014-11-24 23:00:58 +01:00
Lee Hambley
fdeb2f5b70 Comment out cucumber feature which is misleading, keep for reference 2014-11-24 23:00:58 +01:00
Bruno Sutic
f26ee568e2 Update 'symlink linked files' cucumber scenario
When `deploy:symlink:linked_files` task is executed, only the
release path (containing the timestamp) is created.
After the task is done, it is hard to navigate over that release path
(again, because it's a timestamp) to perform the assertions.

To solve the issue, we're additionally creating a current path because
the assertion is much more easily done via `current_path`.
2014-11-17 13:47:24 +01:00
Bruno Sutic
c123fc1def Update 'checking linked files' cucumber scenarios
'Checking linked files' scenarios were passing, but the steps were not
defined at all.
This commit defines the required steps.
2014-11-17 13:47:24 +01:00
Bruno Sutic
a4e11a1435 Delete duplicate cucumber assertion that is unused 2014-11-17 13:47:24 +01:00
Bruno Sutic
31f6e7fde8 Replace an assertion without implementation with the one that works 2014-11-17 13:47:24 +01:00
Bruno Sutic
a91d4eef0c Update assertions for 'git:check' test scenario
Capistrano 'git:check' task executes a `git ls-remote -h #{repo_url}`
command to check if remote repo is accessible. If successful, command
output is a list of references and their SHAs.

Task should be successful and we're pretty sure remote repo will have a
`master` reference, so that's what we're asserting.

We're NOT asserting:
 * repo references other than master - likely to change
 * reference SHAs - will definitely change
2014-11-17 13:47:24 +01:00
Rustam Zagirov
2c14957bf4 move to rspec 3 2014-08-12 22:52:37 +04:00
Travis Petticrew
2e13a1319c Cucumber tests will now run on the latest Vagrant
This removes the dependency on the `kuroko` gem and uses the Vagrant
command line application to control the virtual environment. The
`vagrant` command should be in your path, but if it isn't the path can
be set with the `VAGRANT_BIN` environment variable. This may even work
on older versions of Vagrant, but they are untested.

The `VagrantHelpers` module was added to mimic some of the API that was
provided by `kuroko`. The `RemoteCommandHelpers` module was modified to
accommodate those changes. Any non-zero exit status on a remote command
will raise a `VagrantHelpers::VagrantSSHCommandError` and should be
expected by any tests using the command helpers. All existing tests
work as expected.

In addition, a couple of minor changes were made. The TestApp utilizes
the Pathname library but does not require it. This was causing the suite
to fail for me so I added an explicit require. Also, the test for the
existence of a release directory would give a false positive on
subsequent runs if the `KEEP_RUNNING` option was used. I added an
`at_exit` that removes the test deployment directory to clean up the
box for the next run.

Documentation was also added to the README for how to run the test
suites.
2014-04-23 10:19:20 -05:00
Lee Hambley
319e18e4e6 Merge pull request #892 from miry/load-deploy-and-stage-tasks
Updated the loading default config tasks and stages config tasks
2014-04-15 12:16:39 +02:00
Kir Shatrov
7e41233d76 Using .rake extension instead of .cap
In tests and default templates
2014-01-23 11:07:13 +04:00
Michael Nikitochkin
816b137930 🐼 Updated the loading default config tasks and stages config tasks.
To show all tasks decalred in default config and stages files was missed from the tasks list.
Added default value for :stage and load all default configs. Also added cucumber tests.
2014-01-18 23:18:55 +02:00
seenmyfate
22a98f30a6 Merge branch '3.1.x'
Conflicts:
	CHANGELOG.md
	README.md
	lib/capistrano/tasks/git.rake
	lib/capistrano/templates/deploy.rb.erb
2013-11-02 11:08:10 +00: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
d8b9b695bb Allow configuration location to be configurable
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
2013-10-14 12:44:38 +01:00
seenmyfate
e7399f4692 Integration tests with Vagrant and Cucumber
This commit removes the existing 'local' integration tests and replaces
them with Cucumber features running against VMs.  At this stage,
some of the assertions are pending due to the limited nature of the
response returned when executing commands through Vagrant, but the
framework is there as a starting point to build upon.

To run the suite:

    bundle exec cucumber

During development, avoid scraping the VM between runs:

    bundle exec cucumber KEEPING_RUNNING=1

Ultimately I would like to see the `TestApp` helpers along with the Vagrant
integration packaged and available for use when developing gems that work with
Cap. For now though, this closes #641
2013-09-27 11:45:55 +01:00