discharger 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/discharger/task.rb +30 -29
- data/lib/discharger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fab90fcc905ab5973963cc00dc7e7a5bbf1d47eb0f3f6b2964cf45a2c738bd8
|
4
|
+
data.tar.gz: 2f6017297bde5b922db40eb7285f30a50d9c2e24e5326ca1517e5692bf720e92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fe9d074e80409f8410aa3e2be42dfdc29e481b502a59c06662cd086566918b556b23255a2ced66af1a42a42e7cad17a08849f287777cf81d16b2e1c9527f340
|
7
|
+
data.tar.gz: 3abdfd7cfa71fd7b9106ff59be5a019a36b8b2d5f1b0c728ca1a1ae1cd49284e96e47bb9ac94c761f2ed9d42fa5a740b2c17fd0eb0c4dacbc9f0b8e0b936940d
|
data/lib/discharger/task.rb
CHANGED
@@ -70,8 +70,8 @@ module Discharger
|
|
70
70
|
#
|
71
71
|
# @example
|
72
72
|
# syscall(
|
73
|
-
# ["echo
|
74
|
-
# ["ls
|
73
|
+
# ["echo Hello, World!"],
|
74
|
+
# ["ls -l"]
|
75
75
|
# )
|
76
76
|
def syscall(*steps, output: $stdout, error: $stderr)
|
77
77
|
success = false
|
@@ -137,18 +137,18 @@ module Discharger
|
|
137
137
|
exit if input.chomp.match?(/^x/i)
|
138
138
|
|
139
139
|
continue = syscall(
|
140
|
-
["git
|
141
|
-
["git
|
142
|
-
["git
|
143
|
-
["git
|
144
|
-
["git
|
145
|
-
["git
|
146
|
-
["git
|
147
|
-
["git
|
148
|
-
["git
|
140
|
+
["git checkout #{working_branch}"],
|
141
|
+
["git branch -D #{staging_branch} 2>/dev/null || true"],
|
142
|
+
["git branch -D #{production_branch} 2>/dev/null || true"],
|
143
|
+
["git fetch origin #{staging_branch}:#{staging_branch} #{production_branch}:#{production_branch}"],
|
144
|
+
["git checkout #{production_branch}"],
|
145
|
+
["git rebase #{staging_branch}"],
|
146
|
+
["git tag -a v#{current_version} -m 'Release #{current_version}'"],
|
147
|
+
["git push origin #{production_branch}:#{production_branch} v#{current_version}:v#{current_version}"],
|
148
|
+
["git push origin v#{current_version}"]
|
149
149
|
) do
|
150
|
-
tasker["#{name}:slack"].invoke("Released #{
|
151
|
-
syscall ["git
|
150
|
+
tasker["#{name}:slack"].invoke("Released #{app_name} #{current_version} to production.", release_message_channel, ":chipmunk:")
|
151
|
+
syscall ["git checkout #{working_branch}"]
|
152
152
|
end
|
153
153
|
|
154
154
|
abort "Release failed." unless continue
|
@@ -163,13 +163,13 @@ module Discharger
|
|
163
163
|
tasker["reissue"].invoke
|
164
164
|
new_version = Object.const_get(version_constant)
|
165
165
|
new_version_branch = "bump/begin-#{new_version.tr(".", "-")}"
|
166
|
-
continue = syscall(["git
|
166
|
+
continue = syscall(["git checkout -b #{new_version_branch}"])
|
167
167
|
|
168
168
|
abort "Bump failed." unless continue
|
169
169
|
|
170
170
|
pr_url = "#{pull_request_url}/compare/#{working_branch}...#{new_version_branch}?expand=1&title=Begin%20#{current_version}"
|
171
171
|
|
172
|
-
syscall(["git
|
172
|
+
syscall(["git push origin #{new_version_branch} --force"]) do
|
173
173
|
sysecho <<~MSG
|
174
174
|
Branch #{new_version_branch} created.
|
175
175
|
|
@@ -179,7 +179,7 @@ module Discharger
|
|
179
179
|
Opening PR: #{pr_url}
|
180
180
|
MSG
|
181
181
|
end.then do |success|
|
182
|
-
syscall ["open
|
182
|
+
syscall ["open #{pr_url}"] if success
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
@@ -187,14 +187,14 @@ module Discharger
|
|
187
187
|
desc description
|
188
188
|
task build: :environment do
|
189
189
|
syscall(
|
190
|
-
["git
|
191
|
-
["git
|
192
|
-
["git
|
193
|
-
["git
|
194
|
-
["git
|
190
|
+
["git fetch origin #{working_branch}"],
|
191
|
+
["git checkout #{working_branch}"],
|
192
|
+
["git branch -D #{staging_branch} 2>/dev/null || true"],
|
193
|
+
["git checkout -b #{staging_branch}"],
|
194
|
+
["git push origin #{staging_branch} --force"]
|
195
195
|
) do
|
196
196
|
tasker["#{name}:slack"].invoke("Building #{app_name} #{commit_identifier.call} on #{staging_branch}.", release_message_channel)
|
197
|
-
syscall ["git
|
197
|
+
syscall ["git checkout #{working_branch}"]
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
@@ -228,10 +228,11 @@ module Discharger
|
|
228
228
|
current_version = Object.const_get(version_constant)
|
229
229
|
finish_branch = "bump/finish-#{current_version.tr(".", "-")}"
|
230
230
|
|
231
|
-
syscall
|
232
|
-
["git
|
233
|
-
["git
|
234
|
-
|
231
|
+
syscall(
|
232
|
+
["git fetch origin #{working_branch}"],
|
233
|
+
["git checkout #{working_branch}"],
|
234
|
+
["git checkout -b #{finish_branch}"]
|
235
|
+
)
|
235
236
|
sysecho <<~MSG
|
236
237
|
Branch #{finish_branch} created.
|
237
238
|
|
@@ -256,7 +257,7 @@ module Discharger
|
|
256
257
|
|
257
258
|
pr_url = "#{pull_request_url}/compare/#{finish_branch}?#{params.to_query}"
|
258
259
|
|
259
|
-
continue = syscall ["git
|
260
|
+
continue = syscall ["git push origin #{finish_branch} --force"] do
|
260
261
|
sysecho <<~MSG
|
261
262
|
Branch #{finish_branch} created.
|
262
263
|
Open a PR to #{working_branch} to finalize the release.
|
@@ -269,7 +270,7 @@ module Discharger
|
|
269
270
|
MSG
|
270
271
|
end
|
271
272
|
if continue
|
272
|
-
syscall ["git
|
273
|
+
syscall ["git checkout #{working_branch}"],
|
273
274
|
["open", pr_url]
|
274
275
|
end
|
275
276
|
end
|
@@ -306,7 +307,7 @@ module Discharger
|
|
306
307
|
|
307
308
|
Once the PR is **approved**, run 'rake release' to release the version.
|
308
309
|
MSG
|
309
|
-
syscall ["open
|
310
|
+
syscall ["open #{pr_url}"]
|
310
311
|
end
|
311
312
|
end
|
312
313
|
end
|
data/lib/discharger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: open3
|