capistrano-deploybot 1.1.0 → 1.1.1

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: e7681a63cd918d0df99e11d05c571104614061fe9bd9a24d77909b0ff8c76891
4
- data.tar.gz: 64367a40e53aedbcaf9a51708b2ea52925460e2744a4757608ba5bd3451b9861
3
+ metadata.gz: 1c316494b8c8c8798549de0b9ef00c521f76a8642e2845ef623b70ec6eb4485a
4
+ data.tar.gz: c776e2883344b3fd4d979f24dd23195d0fd05d85cc75cec3575b3986bf88d6f4
5
5
  SHA512:
6
- metadata.gz: 688b536e9c4b7fa738a8fa35bf8798b2727386138b40ea88f79db9a56d4ea87107779dfcfb529ca7108f62bf9e1a0451f66e64d0d17caa856d33c7606a3cd092
7
- data.tar.gz: 9eb32b67d54606a4f5faaf71020f46538ba6d25313a37847eaafac9d797c9b377656faa8a78915deea5433a7501698b18086820d510e548b7cfa037f16279558
6
+ metadata.gz: 4cc31b6a29f976e62738dcaba5b487bff18d242c5d5101b2a0c7a8f38bca96e1e85a2aa20573e3d38f08a79a44f1cc250e0c38eb73f3203ff282682f0966f27d
7
+ data.tar.gz: 97ae53c66e9612886895c453de2e304215e7baa571af3033b7f0f927ded3ea56d74f5fdfe7ecbffbbedd3049fb796f449e23811e19dd402ed992895af1e5de86
@@ -7,6 +7,7 @@ module CapistranoDeploybot
7
7
  class Capistrano
8
8
  DEFAULT_OPTIONS = {
9
9
  username: :autodeploy,
10
+ jira_url: nil,
10
11
  environments: {
11
12
  staging: {
12
13
  slack_webhooks: [],
@@ -15,7 +16,7 @@ module CapistranoDeploybot
15
16
  }
16
17
  }
17
18
 
18
- JIRA_TICKET_ID_REGEXP = /[A-Z]{2,}-\d+/
19
+ JIRA_TICKET_ID_REGEXP = /([A-Z]{2,}-\d+)/
19
20
 
20
21
  def initialize(env)
21
22
  @env = env
@@ -87,7 +88,9 @@ module CapistranoDeploybot
87
88
  end
88
89
 
89
90
  def payload_text(current_revision, previous_revision, deploy_target)
90
- "Deployed to #{deploy_target}:\n" + `git shortlog #{previous_revision}..#{current_revision}`
91
+ message = "Deployed to #{deploy_target}:\n" + `git shortlog #{previous_revision}..#{current_revision}`
92
+ message = message.split("\n").map { |s| s.gsub(JIRA_TICKET_ID_REGEXP, '[\1]' + "(#{URI(@opts[:jira_url]).to_s.chomp('/')}/browse/" + '\1' + ')') }.join("\n") if @opts[:jira_url]
93
+ message
91
94
  end
92
95
 
93
96
  def post_to_webhook(url, payload)
@@ -1,3 +1,3 @@
1
1
  module CapistranoDeploybot
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-deploybot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Baćkowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.1.2
57
+ rubygems_version: 3.3.7
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: Capistrano deploy integration for slack