* Prevents last good release from being deleted on cleanup
Issue: 1907
If there are many failed deployments the relese folders will
still be left there and eventually if deploy:cleanup is
executed it will delete the release that is referenced by the
"current" symlink, potentially causing downtime.
That change will prevent the "current release" from ever being
removed during cleanup.
* Link PR on CHANGELOG
* Verify if current dir exists
Check if current release directory exists instead of relying on
exceptions being raised.
* 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
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`.
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
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