ops_tasks 0.5.6 → 0.5.7

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
  SHA1:
3
- metadata.gz: 1aee2998f57a90cf2aa3c65a11c4c51818b5178d
4
- data.tar.gz: 39e013137e9f1cf6769082b977978d781d28099e
3
+ metadata.gz: 3612d79a77ab0b1078e2a2062d45e0eb33267ffa
4
+ data.tar.gz: dcfae6d6eea8c8154e21295841db9e0ff461040f
5
5
  SHA512:
6
- metadata.gz: 9ef2aa1b7a4a88b6d1ad5e02b4c049843a15478d5f89da8a1c50125b653b277b8d005209ab4a711e5a3e350580667ed319d93a9e2d7ae29b1b3dfa9dfe34d4f1
7
- data.tar.gz: cf789258ed26f0297e9bf7a1a3f36449a0987c802836edb9c413c941e3dfbd26b20004be4bae71b2a4b516a6cc0eab3f59526a79765832545397e76c7169dd03
6
+ metadata.gz: eb8c553474f5f232d713ab134f911fc08543442b0b59ee13bddbb987d36d63cbb39f868d6ac729224450a7f72e847bc4dbd994640ad4fe0493d65047dd1a297f
7
+ data.tar.gz: 41d6b4b95ce3b0378607e685af976c03a12d198cbbf4a00a6d60f1dd23ea7a1e35c3c6d751bfb14a052d1854db90292acc0f3ad5a8d8ff49ec5bba074b84fbef
@@ -1,5 +1,6 @@
1
1
  require 'say2slack'
2
2
  require 'aws-sdk'
3
+ require 'shorturl'
3
4
 
4
5
  module OpsTasks
5
6
  class Deployment
@@ -72,9 +73,11 @@ module OpsTasks
72
73
  end
73
74
 
74
75
  def log_url(deployment_id)
75
- @client.describe_commands(
76
+ deploy = @client.describe_commands(
76
77
  :deployment_id => deployment_id
77
- )[:log_url]
78
+ )[:commands].first
79
+ # p deploy
80
+ ShortURL.shorten deploy[:log_url]
78
81
  end
79
82
 
80
83
 
@@ -103,15 +106,16 @@ module OpsTasks
103
106
  end
104
107
 
105
108
  def announce_log(id)
109
+ return "" if log_url(id).empty?
106
110
  "Chef".
107
- says("<a href='#{log_url(id)}'>failure log</a>").
111
+ says("log: #{URI.encode(log_url(id))}").
108
112
  to_channel(@slack_channel)
109
- puts log_url(id)
113
+ # puts log_url(id)
110
114
  end
111
115
 
112
116
  def poll_api_for_status(deployment_id, running_status = 'running')
113
117
  sleep 1 until assess_status(deployment_id) != running_status
114
- puts assess_status(deployment_id)
118
+ puts "#{assess_status(deployment_id)} (log: #{log_url(deployment_id)})"
115
119
  end
116
120
 
117
121
  def wait_for_completion(deployment_id, task="deployment")
@@ -119,8 +123,7 @@ module OpsTasks
119
123
  announce_status(task, deployment_id)
120
124
  poll_api_for_status(deployment_id)
121
125
  announce_status(task, deployment_id)
122
- announce_log(deployment_id) if deployment_failed?(deployment_id)
123
- Process.daemon if @run_in_background
126
+ # Process.daemon if @run_in_background
124
127
  end
125
128
  end
126
129
  end
@@ -1,3 +1,3 @@
1
1
  module OpsTasks
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
data/ops_tasks.gemspec CHANGED
@@ -24,5 +24,6 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency "highline", "~> 1"
25
25
  s.add_dependency "dotenv", "~> 0"
26
26
  s.add_dependency "figaro", "~> 1"
27
+ s.add_dependency 'shorturl', '~> 1'
27
28
 
28
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Prokesch
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: shorturl
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1'
83
97
  description: AWS Opsworks Rake & CLI Tasks for Deployment
84
98
  email:
85
99
  - nick@prokes.ch