kapost_deploy 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: 465752e220872c86cf728e906b64fa82ff5ba691
4
- data.tar.gz: 5592571df0b04754ce3ed7ba452d7defba8d6b3f
3
+ metadata.gz: f636f108d8ab041901116f42b1b841c2953a17d5
4
+ data.tar.gz: 5548e18ea305b516b29f6447405d6c5ca39a7dc4
5
5
  SHA512:
6
- metadata.gz: 34aa223ee90e83d688b15bacc6464ec20f9608ebd82b8a52e202ce4b491060c4b2fae5c8fb1090cd971f51d298e8f628158bdec4f398798cb7bfda8d1d973e58
7
- data.tar.gz: 86b999a1120428691ae4bb0c6d660c64360e01cf21140d114275a4368c0c47d6b5b04053bff21c8f70489851a69200e5cab93665cf054bd22d18941b331a09f9
6
+ metadata.gz: e35c839413ff6d4d7319e90057b51998c96adc3a26c0e53e83aeaf3c9c063bfb609f9ce678c7ea55853cb8b37ed090ed995722bdca52024be94b877135944980
7
+ data.tar.gz: e79b318d91dbca573c2153a98b58aeca893626a3c254c586ee1ca510d5f00ee6825f906e8f075f4f04ad718dfcfecc6725b17e59dfd8bea91a9748575a24163b
data/README.md CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  - [Features](#features)
12
12
  - [Requirements](#requirements)
13
+ - [Configuration Options](#configuration-options)
13
14
  - [Setup](#setup)
14
15
  - [Tests](#tests)
15
16
  - [Versioning](#versioning)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "platform-api"
3
4
 
4
5
  module KapostDeploy
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "platform-api"
3
4
 
4
5
  module KapostDeploy
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "bundler"
3
4
  require "English"
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module KapostDeploy
3
4
  # Gem identity information.
4
5
  module Identity
@@ -11,7 +12,7 @@ module KapostDeploy
11
12
  end
12
13
 
13
14
  def self.version
14
- "0.2.0"
15
+ "0.3.0"
15
16
  end
16
17
 
17
18
  def self.version_label
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "kapost_deploy/heroku/shell"
3
4
 
4
5
  module KapostDeploy
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "kapost_deploy/heroku/app_releases"
4
+
5
+ module KapostDeploy
6
+ module Plugins
7
+ # After-promotion plugin to notify honeybadger after a promotion is complete.
8
+ # Honeybadger.io can be configured to clear all honeybadgers upon this deploy notification.
9
+ class NotifyHoneyBadgerAfterPromote
10
+ def initialize(config,
11
+ ahead_releases: KapostDeploy::Heroku::AppReleases.new(config.app, token: config.heroku_api_token),
12
+ kernel: Kernel)
13
+
14
+ self.config = config
15
+ self.git_config = config.options.fetch(:git_config, {})
16
+ self.ahead_releases = ahead_releases
17
+ self.kernel = kernel
18
+ end
19
+
20
+ def after
21
+ return unless configured?
22
+
23
+ notify_honeybadger
24
+ end
25
+
26
+ private
27
+
28
+ attr_accessor :config, :git_config, :ahead_releases, :kernel
29
+
30
+ def notify_honeybadger
31
+ kernel.system("bundle exec honeybadger deploy -e #{env} -s #{commit_sha} -r #{repository_url}")
32
+ end
33
+
34
+ def env
35
+ config.to.split("-").last
36
+ end
37
+
38
+ def commit_sha
39
+ ci_sha || pipeline_sha
40
+ end
41
+
42
+ def ci_sha
43
+ ENV["CIRCLE_SHA1"]
44
+ end
45
+
46
+ def pipeline_sha
47
+ ahead_releases.latest_deploy_version
48
+ end
49
+
50
+ def github_repo
51
+ git_config[:github_repo] unless git_config.nil?
52
+ end
53
+
54
+ def repository_url
55
+ "https://github.com/#{github_repo}"
56
+ end
57
+
58
+ def configured?
59
+ !github_repo.nil? && !github_repo.empty?
60
+ end
61
+ end
62
+ end
63
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "kapost_deploy/slack/notifier"
3
4
 
4
5
  module KapostDeploy
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "kapost_deploy/slack/notifier"
3
4
  require "kapost_deploy/heroku/app_releases"
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "slack-notify"
3
4
 
4
5
  module KapostDeploy
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "rake"
3
4
  require "rake/tasklib"
4
5
  require "kapost_deploy/heroku/app_promoter"
data/lib/kapost_deploy.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "kapost_deploy/identity"
3
4
  require "kapost_deploy/task"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kapost_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Croft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -53,63 +53,49 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.4.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: honeybadger
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.11'
62
- type: :development
61
+ version: '2.0'
62
+ type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.11'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
68
+ version: '2.0'
83
69
  - !ruby/object:Gem::Dependency
84
- name: pry-byebug
70
+ name: bundler
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - ">="
73
+ - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '0'
75
+ version: '1.11'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - ">="
80
+ - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: '1.11'
97
83
  - !ruby/object:Gem::Dependency
98
- name: pry-remote
84
+ name: gemsmith
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - ">="
87
+ - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: '7.7'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ">="
94
+ - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: '0'
96
+ version: '7.7'
111
97
  - !ruby/object:Gem::Dependency
112
- name: pry-state
98
+ name: pry
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - ">="
@@ -123,7 +109,7 @@ dependencies:
123
109
  - !ruby/object:Gem::Version
124
110
  version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
- name: pry-rescue
112
+ name: pry-byebug
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - ">="
@@ -137,7 +123,7 @@ dependencies:
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
- name: pry-stack_explorer
126
+ name: pry-state
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - ">="
@@ -226,14 +212,14 @@ dependencies:
226
212
  requirements:
227
213
  - - "~>"
228
214
  - !ruby/object:Gem::Version
229
- version: '0.37'
215
+ version: '0.40'
230
216
  type: :development
231
217
  prerelease: false
232
218
  version_requirements: !ruby/object:Gem::Requirement
233
219
  requirements:
234
220
  - - "~>"
235
221
  - !ruby/object:Gem::Version
236
- version: '0.37'
222
+ version: '0.40'
237
223
  - !ruby/object:Gem::Dependency
238
224
  name: codeclimate-test-reporter
239
225
  requirement: !ruby/object:Gem::Requirement
@@ -249,7 +235,7 @@ dependencies:
249
235
  - !ruby/object:Gem::Version
250
236
  version: '0'
251
237
  - !ruby/object:Gem::Dependency
252
- name: rubygems-tasks
238
+ name: climate_control
253
239
  requirement: !ruby/object:Gem::Requirement
254
240
  requirements:
255
241
  - - ">="
@@ -277,6 +263,7 @@ files:
277
263
  - lib/kapost_deploy/heroku/shell.rb
278
264
  - lib/kapost_deploy/identity.rb
279
265
  - lib/kapost_deploy/plugins/db_migrate.rb
266
+ - lib/kapost_deploy/plugins/notify_honeybadger_after_promote.rb
280
267
  - lib/kapost_deploy/plugins/slack_after_promote.rb
281
268
  - lib/kapost_deploy/plugins/slack_github_diff.rb
282
269
  - lib/kapost_deploy/slack/notifier.rb