Skip to content

Commit

Permalink
Merge pull request #18 from chubchenko/hotfix/backend
Browse files Browse the repository at this point in the history
Add fall back in case of the primary server is not defined
  • Loading branch information
chubchenko authored Nov 11, 2021
2 parents 0f469f9 + 9d086da commit 1989716
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Add fall back in case of the primary server is not defined. ([@chubchenko][])
- Require `json` to convert `Hash` object to `JSON`. ([@chubchenko][])

## [0.1.4] - 2021-07-27
### Fixed
Expand Down
4 changes: 3 additions & 1 deletion lib/capistrano/slacky/on.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class Path
module_function

def on(within:, &block)
::Capistrano::DSL.on(::Capistrano::Configuration.env.primary(:app)) do
role = ::Capistrano::Configuration.env.primary(:app) || ::Capistrano::Configuration.env.roles(:all).first

::Capistrano::DSL.on(role) do
::SSHKit::Backend.current.within(PATH_MAP.fetch(within).call, &block)
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/capistrano/slacky/payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
module Capistrano
module Slacky
class Payload
require "json"

def initialize(env:, action:)
@env = env
@action = action
Expand Down

0 comments on commit 1989716

Please sign in to comment.