capistrano-slacky 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4376f99f85cd346b93ac12f632e2e48b412fb63fa4e08df39b90caa1d2ad677
4
- data.tar.gz: c3dba2f05bee71965340ecd4c916930220ace00bc68f223ed182367afc7a3d15
3
+ metadata.gz: 6e892f62e82295a36d7682081bd49b9325ca4acfb6b7567d35b3d30eee900586
4
+ data.tar.gz: b2fe16318ad7a07fe5152615b3ddaed80e5a50cf8003b3091ca8aa7a1b2d7f2a
5
5
  SHA512:
6
- metadata.gz: bc260001544951a188d32e91542f63c59508d3abefd8e8656b8b8b14b95ae37efa7e2bd40e3c1a4b0f533d3722b68287fa9ae9112a14311babdac00d1ca50a2c
7
- data.tar.gz: e1885a2c60f1fc88f98a1dcefd06bdd689477484963a2cf50229b41d574d170830dbf326eaa5ea3ab49ff435897b68e8af883a4d58ecf5f11574550de1053eea
6
+ metadata.gz: 5f1fafa918f99df51308081d599b96c22d97800629695ffe5f2073e8eb97df259eec2b367776b0f04f4c575350bef4f35b42212b63e6971649aba93e84377e67
7
+ data.tar.gz: 8a913baa0918ba16b2ff02ecd4db61984a850ca2b3ca41ad5516bc60988dfbe0b70f31d1d8ded6a1f901078366103a30eb744031b94141be7a868491c36d0f95
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.4] - 2021-07-27
10
+ ### Fixed
11
+ - Ensure that `:current_revision` exists during rollback. ([@chubchenko][])
12
+
9
13
  ## [0.1.3] - 2021-06-14
10
14
  ### Changed
11
15
  - Update `README.md`. ([@chubchenko][])
@@ -40,7 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
40
44
  - Initial version. ([@chubchenko][])
41
45
 
42
46
  [@chubchenko]: https://github.com/chubchenko
43
- [Unreleased]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.3...HEAD
47
+ [Unreleased]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.4...HEAD
48
+ [0.1.4]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.3...v0.1.4
44
49
  [0.1.3]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.2...v0.1.3
45
50
  [0.1.2]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.1...v0.1.2
46
51
  [0.1.1]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.0...v0.1.1
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "command/current_revision"
3
4
  require_relative "command/duration"
4
5
  require_relative "command/diff"
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Capistrano
4
+ module Slacky
5
+ module Command
6
+ class CurrentRevision
7
+ REVISION_FILE = "REVISION"
8
+
9
+ private_constant :REVISION_FILE
10
+
11
+ def self.call
12
+ output = nil
13
+
14
+ ::Capistrano::Slacky.on(within: :release) do
15
+ output = ::SSHKit::Backend.current.capture(:cat, REVISION_FILE)
16
+ end
17
+
18
+ output
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -9,7 +9,8 @@ module Capistrano
9
9
 
10
10
  PATH_MAP = {
11
11
  repository: -> { Path.repo_path },
12
- shared: -> { Path.shared_path }
12
+ shared: -> { Path.shared_path },
13
+ release: -> { Path.release_path }
13
14
  }.freeze
14
15
 
15
16
  private_constant :PATH_MAP
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module Slacky
5
- VERSION = "0.1.3"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
@@ -7,7 +7,7 @@ namespace :slacky do
7
7
  end
8
8
 
9
9
  desc "Slacky after successful rollback"
10
- task :reverted do
10
+ task reverted: [:ensure_current_revision] do
11
11
  Capistrano::Slacky::Runner.call(action: :reverted)
12
12
  end
13
13
 
@@ -25,4 +25,9 @@ namespace :slacky do
25
25
  Capistrano::Slacky::Runner.call(action: action)
26
26
  end
27
27
  end
28
+
29
+ desc "Ensure that the current revision is set"
30
+ task :ensure_current_revision do
31
+ set_if_empty(:current_revision) { Capistrano::Slacky::Command::CurrentRevision.call }
32
+ end
28
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-slacky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Chubchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2021-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -90,6 +90,7 @@ files:
90
90
  - lib/capistrano/slacky/block/root.rb
91
91
  - lib/capistrano/slacky/block/section.rb
92
92
  - lib/capistrano/slacky/command.rb
93
+ - lib/capistrano/slacky/command/current_revision.rb
93
94
  - lib/capistrano/slacky/command/diff.rb
94
95
  - lib/capistrano/slacky/command/duration.rb
95
96
  - lib/capistrano/slacky/configuration.rb