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
Darwin D Wu
a76b0766b0 deploy:cleanup should skip only the invalid releases and continue the rotation of releases (#1899)
* deploy:cleanup should skip only the invalid releases and continue the rotation
of releases

* Add cucumber tests for deploy:cleanup

* PR feedback

* rebase on master

* add ruby 2.4.1 to specs

* vagrant works with bundler 1.15.3

* remove unnecessary command
2017-07-22 16:15:44 -07:00
Berin Larson
ed0a3f08df Adds acceptance test for rollback feature. (#1891)
* #1736 Adds acceptance test for rollback feature.
* Made vagrant_cli_command function return values explicitly over setting instance variables.
2017-07-04 19:02:58 -07:00
Matt Brictson
84407c63a7
Use empty app as background for cap install tests
Previously, a fully-configured app was used as the background for the
`cap install` feature tests. This somewhat defeated the purpose of these
tests, because `cap install` is supposed to be run on a project that
hasn't yet been "capified".
2017-03-19 19:58:09 -07:00
Matt Brictson
ba8115a8f7
Allow cap to be run within subdir and still work
Much like rake can find its Rakefile even when run in a subdirectory,
cap can now find its Capfile. Since cap is built on top of rake, this
was really just restoring default behavior that was accidentally
overridden.

Also add a feature test to ensure it works.
2017-03-06 07:33:47 -08:00
Matt Brictson
55c684f8a0
Properly shell escape git:wrapper steps
The `upload!` method does escaping of its own internally, so we don't
need to do anything special there. Likewise environment variables are
already handled. The only place we need to explicitly `shellescape` is
when executing the `chmod` command.

Verify this all works as expected by changing the user in the Cucumber
features to be `(GitHub Web Flow) via ShipIt`. This user is now used
when exercising the `git:check` task.

Fixes #1842.
2017-02-09 21:45:06 -08:00
Matt Brictson
1adf2508bd Raise if a stage has an invalid name like "deploy" 2016-05-21 11:55:57 -07:00
Maciek Dubinski
b3f7c46c19 Restricting the uploaded git wrapper file permissions to 700.
Additional step in the 'Creating the repo' scenario to test this adjustment.
2016-05-17 16:25:38 +02:00
William Johnston
91777db59f Enable RescueModifier cop 2016-03-10 08:01:15 -06:00
William Johnston
9dc9462d04 Fix Style/SpaceAroundBlockParameters 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
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
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
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