discharger 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/discharger/task.rb +13 -3
- data/lib/discharger/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f399dc08de3d54286fe7030a7b7a0e15a2055f9aa62d760073f692f96b0e8b46
|
4
|
+
data.tar.gz: a1f5ce7018dc556f7b18da3fc837cfde7efb589de3c3527e9ad69ba78a78096d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b04988a2af1edd4f28ffc2490839df815a4e551456f0d9c4e5a9e23f2ccb774e6e0b6ef313890c85e8fdf5f8bb273934fbaab30cf2088f6b933f272de65abcfb
|
7
|
+
data.tar.gz: 4be4ec992ed4e59d4335c8ad2110d603379ec729c402af8c85db2d7e606f19966a2c3d03aae82d45f7c072a060d76669f18649680270e6e42e83c5f86a289c04
|
data/lib/discharger/task.rb
CHANGED
@@ -37,6 +37,8 @@ module Discharger
|
|
37
37
|
attr_accessor :commit_identifier
|
38
38
|
attr_accessor :pull_request_url
|
39
39
|
|
40
|
+
attr_reader :last_message_ts
|
41
|
+
|
40
42
|
# Reissue settings
|
41
43
|
attr_accessor(
|
42
44
|
*Reissue::Task.instance_methods(false).reject { |method|
|
@@ -145,7 +147,12 @@ module Discharger
|
|
145
147
|
["git push origin #{production_branch}:#{production_branch} v#{current_version}:v#{current_version}"],
|
146
148
|
["git push origin v#{current_version}"]
|
147
149
|
) do
|
148
|
-
tasker["#{name}:slack"].invoke("Released #{app_name} #{current_version} to production.", release_message_channel, ":chipmunk:")
|
150
|
+
tasker["#{name}:slack"].invoke("Released #{app_name} #{current_version} (#{commit_identifier.call}) to production.", release_message_channel, ":chipmunk:")
|
151
|
+
if last_message_ts.present?
|
152
|
+
text = File.read(Rails.root.join(changelog_file))
|
153
|
+
tasker["#{name}:slack"].reenable
|
154
|
+
tasker["#{name}:slack"].invoke(text, release_message_channel, ":log:", last_message_ts)
|
155
|
+
end
|
149
156
|
syscall ["git checkout #{working_branch}"]
|
150
157
|
end
|
151
158
|
|
@@ -199,17 +206,18 @@ module Discharger
|
|
199
206
|
syscall(
|
200
207
|
["git fetch origin #{working_branch}"],
|
201
208
|
["git checkout #{working_branch}"],
|
209
|
+
["git reset --hard origin/#{working_branch}"],
|
202
210
|
["git branch -D #{staging_branch} 2>/dev/null || true"],
|
203
211
|
["git checkout -b #{staging_branch}"],
|
204
212
|
["git push origin #{staging_branch} --force"]
|
205
213
|
) do
|
206
|
-
tasker["#{name}:slack"].invoke("Building #{app_name} #{commit_identifier.call} on #{staging_branch}.", release_message_channel)
|
214
|
+
tasker["#{name}:slack"].invoke("Building #{app_name} #{current_version} (#{commit_identifier.call}) on #{staging_branch}.", release_message_channel)
|
207
215
|
syscall ["git checkout #{working_branch}"]
|
208
216
|
end
|
209
217
|
end
|
210
218
|
|
211
219
|
desc "Send a message to Slack."
|
212
|
-
task :slack, [:text, :channel, :emoji] => :environment do |_, args|
|
220
|
+
task :slack, [:text, :channel, :emoji, :ts] => :environment do |_, args|
|
213
221
|
args.with_defaults(
|
214
222
|
channel: release_message_channel,
|
215
223
|
emoji: nil
|
@@ -217,9 +225,11 @@ module Discharger
|
|
217
225
|
client = Slack::Web::Client.new
|
218
226
|
options = args.to_h
|
219
227
|
options[:icon_emoji] = options.delete(:emoji) if options[:emoji]
|
228
|
+
options[:thread_ts] = options.delete(:ts) if options[:ts]
|
220
229
|
|
221
230
|
sysecho "Sending message to Slack:".bg(:green).black + " #{args[:text]}"
|
222
231
|
result = client.chat_postMessage(**options)
|
232
|
+
instance_variable_set(:@last_message_ts, result["ts"])
|
223
233
|
sysecho %(Message sent: #{result["ts"]})
|
224
234
|
end
|
225
235
|
|
data/lib/discharger/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discharger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
8
|
+
- Savannah Moore
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date: 2025-
|
11
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: open3
|