ops_deploy 0.1.6.2 → 0.1.7
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/ops_deploy/cli.rb +27 -4
- data/lib/ops_deploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2fd85c660f1062efc8fa2dde99d8d2998145d66
|
4
|
+
data.tar.gz: d5ef764749f64ac99de1b342d57174d41b4e613a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2cba0577551b5bf550fae30b75ee3ac788e7d446a49751b492369449e590250719cd59569e5f349c65898ef7969a06064ff0c409c3d5360898725ff4c8e395
|
7
|
+
data.tar.gz: a927a15b7edb4560cef2966323fa7016a85f159520179c5b7a429d8c0509287e6a9c39dce28257f1437558080896cc5aa41e45a972d9326465b0ba36f2abd79c
|
data/lib/ops_deploy/cli.rb
CHANGED
@@ -47,8 +47,10 @@ class OpsDeploy::CLI
|
|
47
47
|
stack = find_stack(stack_id_name_or_object)
|
48
48
|
|
49
49
|
if via_proxy
|
50
|
+
slack_webhook_url = OpsDeploy::CLI.argument('slack-webhook-url', 'SLACK_WEBHOOK_URL')
|
50
51
|
Pusher.url = OpsDeploy::CLI.argument('pusher-url', 'PUSHER_URL', true)
|
51
|
-
Pusher
|
52
|
+
Pusher.trigger('OpsDeploy', 'wait_for_deployments', stack: stack.stack_id,
|
53
|
+
slack: slack_webhook_url)
|
52
54
|
else
|
53
55
|
step_msg('Checking deployments...')
|
54
56
|
@main.deployments_callback = proc { |deployment|
|
@@ -80,8 +82,10 @@ class OpsDeploy::CLI
|
|
80
82
|
stack = find_stack(stack_id_name_or_object)
|
81
83
|
|
82
84
|
if via_proxy
|
85
|
+
slack_webhook_url = OpsDeploy::CLI.argument('slack-webhook-url', 'SLACK_WEBHOOK_URL')
|
83
86
|
Pusher.url = OpsDeploy::CLI.argument('pusher-url', 'PUSHER_URL', true)
|
84
|
-
Pusher
|
87
|
+
Pusher.trigger('OpsDeploy', 'check_instances', stack: stack.stack_id,
|
88
|
+
slack: slack_webhook_url)
|
85
89
|
else
|
86
90
|
@main.instances_check_callback = proc { |instance, response, error|
|
87
91
|
puts
|
@@ -121,8 +125,11 @@ class OpsDeploy::CLI
|
|
121
125
|
info = data
|
122
126
|
info = JSON.parse(data) if data.is_a?(String)
|
123
127
|
stack_id = info['stack'] || info[:stack]
|
128
|
+
slack_webhook_url = info['slack'] || info[:slack]
|
124
129
|
|
125
|
-
|
130
|
+
with_slack_webhook(slack_webhook_url) do
|
131
|
+
check_instances(stack_id)
|
132
|
+
end
|
126
133
|
rescue StandardError => e
|
127
134
|
puts e
|
128
135
|
end
|
@@ -133,8 +140,11 @@ class OpsDeploy::CLI
|
|
133
140
|
info = data
|
134
141
|
info = JSON.parse(data) if data.is_a?(String)
|
135
142
|
stack_id = info['stack'] || info[:stack]
|
143
|
+
slack_webhook_url = info['slack'] || info[:slack]
|
136
144
|
|
137
|
-
|
145
|
+
with_slack_webhook(slack_webhook_url) do
|
146
|
+
wait_for_deployments(stack_id)
|
147
|
+
end
|
138
148
|
rescue StandardError => e
|
139
149
|
puts e
|
140
150
|
end
|
@@ -144,6 +154,19 @@ class OpsDeploy::CLI
|
|
144
154
|
socket.connect
|
145
155
|
end
|
146
156
|
|
157
|
+
def with_slack_webhook(slack_webhook_url = nil)
|
158
|
+
old_notifier = @notifier
|
159
|
+
if slack_webhook_url && !slack_webhook_url.strip.empty?
|
160
|
+
@notifier = OpsDeploy::CLI::Notifier.new(slack: {
|
161
|
+
webhook_url: slack_webhook_url
|
162
|
+
})
|
163
|
+
end
|
164
|
+
|
165
|
+
yield
|
166
|
+
|
167
|
+
@notifier = old_notifier
|
168
|
+
end
|
169
|
+
|
147
170
|
def self.argument(argv_name, env_name = nil, required = false)
|
148
171
|
value = nil
|
149
172
|
value = ENV[env_name] if env_name
|
data/lib/ops_deploy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ops_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mahdi Bchetnia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|