ops_deploy 0.1.8.1 → 0.1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ops_deploy/cli.rb +15 -7
- data/lib/ops_deploy/cli/notifier.rb +2 -0
- data/lib/ops_deploy/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7463a676e488caa261d788eacc2a76dc14421deb
|
4
|
+
data.tar.gz: 66895b1ba36e7cca89161905a9dcfbedc46a5fba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fa75606b0aaac3b8d38ab909b355c2258422488d6e626fa860ba856e4cb86785af449c2f9cda7aef512f24b3a5059748fa136735e991d933e6ec7bfd5dcc8f0
|
7
|
+
data.tar.gz: 9e5fe8b24496a3fba3e3fdd669c44ff9f474e064c97c6a3aa1017b609d68ac480d4b569bb44716f4ddb9408d896d5eee58ff80002fe3bec78d7a9db046ad6c45
|
data/lib/ops_deploy/cli.rb
CHANGED
@@ -18,10 +18,11 @@ class OpsDeploy::CLI
|
|
18
18
|
@main = OpsDeploy.new(config)
|
19
19
|
@stacks = {}
|
20
20
|
@notifier = OpsDeploy::CLI::Notifier.new(slack: {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
webhook_url: OpsDeploy::CLI.argument('slack-webhook-url', 'SLACK_WEBHOOK_URL'),
|
22
|
+
username: OpsDeploy::CLI.argument('slack-username', 'SLACK_USERNAME'),
|
23
|
+
channel: OpsDeploy::CLI.argument('slack-channel', 'SLACK_CHANNEL'),
|
24
|
+
notify_user: OpsDeploy::CLI.argument('slack-notify-user', 'SLACK_NOTIFY_USER')
|
25
|
+
})
|
25
26
|
|
26
27
|
@notification_messages = {
|
27
28
|
info: [],
|
@@ -59,12 +60,18 @@ class OpsDeploy::CLI
|
|
59
60
|
slack: @notifier.options[:slack])
|
60
61
|
else
|
61
62
|
step_msg('Checking deployments...')
|
63
|
+
notify_user = @notifier.notify_user
|
64
|
+
|
62
65
|
@main.deployments_callback = proc { |deployment|
|
63
66
|
puts
|
64
67
|
if (deployment.status == 'successful')
|
65
|
-
success_msg('Deployment', 'OK'.green.bold,
|
68
|
+
success_msg('Deployment', 'OK'.green.bold,
|
69
|
+
deployment.duration ? "(#{deployment.duration}s)" : '',
|
70
|
+
notify_user ? "@#{notify_user}" : '')
|
66
71
|
else
|
67
|
-
failure_msg('Deployment', 'Failed'.red.bold,
|
72
|
+
failure_msg('Deployment', 'Failed'.red.bold,
|
73
|
+
deployment.duration ? "(#{deployment.duration}s)" : '',
|
74
|
+
notify_user ? "@#{notify_user}" : '')
|
68
75
|
end
|
69
76
|
}
|
70
77
|
|
@@ -77,7 +84,8 @@ class OpsDeploy::CLI
|
|
77
84
|
|
78
85
|
info_msg('Deployments finished')
|
79
86
|
else
|
80
|
-
info_msg('No running deployments on stack', "'#{stack_id_name_or_object.blue}'"
|
87
|
+
info_msg('No running deployments on stack', "'#{stack_id_name_or_object.blue}'",
|
88
|
+
notify_user ? "@#{notify_user}" : '')
|
81
89
|
end
|
82
90
|
|
83
91
|
send_notification(stack)
|
@@ -3,12 +3,14 @@ class OpsDeploy::CLI::Notifier
|
|
3
3
|
attr_accessor :options
|
4
4
|
attr_accessor :messages
|
5
5
|
attr_accessor :notification_type
|
6
|
+
attr_accessor :notify_user
|
6
7
|
|
7
8
|
def initialize(options)
|
8
9
|
@options = options
|
9
10
|
@options.delete(:slack) if @options[:slack].nil? || @options[:slack][:webhook_url].nil?
|
10
11
|
@messages = OpsDeploy::CLI::Notifier::Messages.new
|
11
12
|
@notification_type = :info
|
13
|
+
@notify_user = @options[:slack] ? @options[:slack][:notify_user] : nil
|
12
14
|
end
|
13
15
|
|
14
16
|
def notify(stack)
|
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.8.
|
4
|
+
version: 0.1.8.2
|
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-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -131,9 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: 1.3.6
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project: ops_deploy
|
134
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.5.1
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Perform deployment & checks on AWS OpsWorks
|
138
138
|
test_files: []
|
139
|
-
has_rdoc:
|