capistrano-deploybot 0.0.1 → 0.0.2

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: 05b4947014385caab09399ef8ddc9c99746d6ace
4
- data.tar.gz: 2b2b36cf0cb891aac9f4cf38a94afbabfc4cbce9
3
+ metadata.gz: dea9b2ebdb899bb3b04eeff196cd673f9fe79fdb
4
+ data.tar.gz: 8ea46f88cbbbdc5f789dabb6687041ec5be718a7
5
5
  SHA512:
6
- metadata.gz: 788b096095f3bcf20efa822fbf41218748811e702e6ece93e92d7b9babafe5246751a0a5e61e24fab0c0c4e63652ead94be6e33351a12ffa478cc74cc4a860f8
7
- data.tar.gz: 6a429f9b1b5e5a39be80dd0b5b563abc542868979316a162382c1d0d2b42eae1f2e6f4975390192e8fe3f4761b76ec6e57581673e474de12967e72afe70bd6d8
6
+ metadata.gz: e5b2c951d7b9febb1bb8b83bf91103199f51472c700d3b57a035cc05ccd9021d006f0d84e1a417996d2a133687bbe746a2c3bd40568fea6c5cd9745f44d32cd6
7
+ data.tar.gz: 04d5872b69158d1d62acf40baa51809c81c3c7d232a8bda3bd8effe7ac62e78319b0066118281f3dda87e92802c5a5667d43a1174ba6d45f59885674ce004d0b
@@ -1,6 +1,9 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require 'capistrano-deploybot/version'
3
+
1
4
  Gem::Specification.new do |s|
2
5
  s.name = 'capistrano-deploybot'
3
- s.version = '0.0.1'
6
+ s.version = CapistranoDeploybot::VERSION
4
7
  s.homepage = 'https://github.com/kbackowski/capistrano-deploybot'
5
8
  s.description = 'Notify slack channel with list of deployed commits'
6
9
  s.date = '2017-03-07'
@@ -10,5 +13,5 @@ Gem::Specification.new do |s|
10
13
  s.files = `git ls-files`.split($/)
11
14
  s.license = 'MIT'
12
15
 
13
- s.add_dependency 'capistrano', '>= 3.5.0'
16
+ s.add_dependency 'capistrano', '~> 3.5'
14
17
  end
@@ -22,9 +22,11 @@ module CapistranoDeploybot
22
22
 
23
23
  return if !@opts[:environments].include?(rails_env.to_s) || current_revision == previous_revision
24
24
 
25
+ application_name = @opts[:application_name]
26
+ deploy_target = deploy_target(rails_env, application_name)
25
27
  payload = {
26
28
  username: @opts[:username],
27
- text: payload_text(current_revision, previous_revision, rails_env)
29
+ text: payload_text(current_revision, previous_revision, deploy_target)
28
30
  }
29
31
 
30
32
  @opts[:webhooks].each do |webhook|
@@ -34,8 +36,12 @@ module CapistranoDeploybot
34
36
 
35
37
  private
36
38
 
37
- def payload_text(current_revision, previous_revision, rails_env)
38
- "Deployed to #{rails_env}:\n" + `git shortlog #{previous_revision}..#{current_revision}`
39
+ def deploy_target(rails_env, application_name)
40
+ application_name.nil? ? rails_env : "#{application_name} (#{rails_env})"
41
+ end
42
+
43
+ def payload_text(current_revision, previous_revision, deploy_target)
44
+ "Deployed to #{deploy_target}:\n" + `git shortlog #{previous_revision}..#{current_revision}`
39
45
  end
40
46
 
41
47
  def post_to_webhook(payload)
@@ -1,3 +1,3 @@
1
1
  module CapistranoDeploybot
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-deploybot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Baćkowski
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: capistrano
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.5.0
19
+ version: '3.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.5.0
26
+ version: '3.5'
27
27
  description: Notify slack channel with list of deployed commits
28
28
  email: kbackowski@gmail.com
29
29
  executables: []