Skip to content

Commit

Permalink
Set :capistrano_pending_role default to match :magento_deploy_setup_r…
Browse files Browse the repository at this point in the history
…ole to avoid potential incompatibilities

Resolves #58
  • Loading branch information
davidalger committed Feb 23, 2017
1 parent 96b1c05 commit 2909052
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ UNRELEASED
==========

* Fixed inability to set PATH in capistrano configuration vs `.bashrc` file (issue #62)
* Fixed potential incompatibility with `capistrano-pending` default deployment settings (issue #58)
* Updated README to reflect removing the `terminal-notifier` gem as a hard dependency (issue #19)

0.5.9
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ To add the `capistrano-pending` gem's enhanced functionality to you project, add
require 'capistrano/magento2/pending'
```

In order to make the `capistrano-pending` gem fully compatible with this gem out of the box, the `:capistrano_pending_role` setting has been configured to default to the value of `:magento_deploy_setup_role`. The `capistrano-pending` gem by default looks only at the `:db` role, breaking things if a project does not have code deployed to servers under the `:db` role, as would be the case when using a server configuration similar to the following:

```ruby
role :app, %w{
www-data@web1
www-data@web2
}
```

## Development

After checking out the repo, run `bundle install` to install dependencies. Make the necessary changes, then run `bundle exec rake install` to install a modified version of the gem on your local system.
Expand Down
3 changes: 3 additions & 0 deletions lib/capistrano/magento2/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@
# deploy targetting defaults
set :magento_deploy_setup_role, fetch(:magento_deploy_setup_role, :all)
set :magento_deploy_cache_shared, fetch(:magento_deploy_cache_shared, true)

# set capistrano-pending defaults to match this gem's expectations
set :capistrano_pending_role, fetch(:magento_deploy_setup_role)
2 changes: 1 addition & 1 deletion lib/capistrano/tasks/pending.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace :deploy do
# changes and/or warn that there is nothing to deploy
namespace :pending do
task :check_changes do
on primary fetch(:magento_deploy_setup_role) do
on primary fetch(:capistrano_pending_role) do
# check for pending changes only if REVISION file exists to prevent error
if test "[ -f #{current_path}/REVISION ]"
invoke 'deploy:pending:setup'
Expand Down

0 comments on commit 2909052

Please sign in to comment.