afterlife 1.5.0 → 1.6.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e4638508e3ce213a3fa2153f379d4ec46f4853f2e3e5e51de581ce67895c2a
|
4
|
+
data.tar.gz: 8f390b018a8317bbd7c34be245e7515ed86da8305b1c8277ef8845def65e5b87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4393072985a2d8ed6d91cd33dc46ccb2c9ab14474f42aaedc7925e4623ff690a465059799b7dcbf1e59111350e0b7c5368520b68fd0b5909d155ea49e907dabb
|
7
|
+
data.tar.gz: 1331c720e2f79068e2ea72734b92336f9cf6468e24f64d94c8bbfcd5511b40f556d7c0dacda9f4562a6221542caafaf4e62297fcabf9511a9971e43eefc224f8
|
data/lib/afterlife/deploy/cli.rb
CHANGED
@@ -13,10 +13,8 @@ module Afterlife
|
|
13
13
|
Afterlife.cli = self
|
14
14
|
Deploy.call(stage, options) do |deployment|
|
15
15
|
setup_deploy(deployment)
|
16
|
-
|
17
|
-
|
18
|
-
say_status 'Deployed', deployment.output
|
19
|
-
run_after_hooks
|
16
|
+
process_deploy(deployment)
|
17
|
+
Notify.call(Afterlife.current_repo.name, Afterlife.current_stage.name)
|
20
18
|
end
|
21
19
|
rescue Afterlife::Error => e
|
22
20
|
fatal!(e.message)
|
@@ -24,6 +22,13 @@ module Afterlife
|
|
24
22
|
|
25
23
|
private
|
26
24
|
|
25
|
+
def process_deploy(deployment)
|
26
|
+
say_status 'Deploying', deployment.initial_message
|
27
|
+
deployment.run
|
28
|
+
say_status 'Deployed', deployment.output
|
29
|
+
run_after_hooks
|
30
|
+
end
|
31
|
+
|
27
32
|
def run_after_hooks
|
28
33
|
return if options['skip-after-hooks']
|
29
34
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'net/http'
|
4
|
+
|
5
|
+
module Afterlife
|
6
|
+
module Notify
|
7
|
+
module_function
|
8
|
+
|
9
|
+
def call(repository, branch)
|
10
|
+
return if notification_url.empty?
|
11
|
+
|
12
|
+
response = send_request(repository, branch)
|
13
|
+
|
14
|
+
return if response.code == '200'
|
15
|
+
|
16
|
+
fail Error,
|
17
|
+
"The deploy notification URL returned a #{response.code} status code, " \
|
18
|
+
'and the notification may not have been sent.'
|
19
|
+
end
|
20
|
+
|
21
|
+
def notification_url
|
22
|
+
@notification_url ||= ENV.fetch('AFTERLIFE_DEPLOY_NOTIFICATION_URL', nil) \
|
23
|
+
|| Afterlife.config.deploy_notification_url \
|
24
|
+
|| Afterlife.current_repo.conf.dig(:deploy, :deploy_notification_url) \
|
25
|
+
|| ''
|
26
|
+
end
|
27
|
+
|
28
|
+
def send_request(repository, branch)
|
29
|
+
uri = URI(notification_url)
|
30
|
+
body = {
|
31
|
+
branch: branch,
|
32
|
+
repository: repository,
|
33
|
+
}
|
34
|
+
headers = { 'Content-Type': 'application/json' }
|
35
|
+
Net::HTTP.post(uri, body.to_json, headers)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/afterlife/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: afterlife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genaro Madrid
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/afterlife/deploy/kubernetes_deployment.rb
|
134
134
|
- lib/afterlife/environment.rb
|
135
135
|
- lib/afterlife/exec.rb
|
136
|
+
- lib/afterlife/notify.rb
|
136
137
|
- lib/afterlife/release.rb
|
137
138
|
- lib/afterlife/release/change_version.rb
|
138
139
|
- lib/afterlife/release/cli.rb
|