opsicle 0.7.0 → 0.7.1

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzdlMWE1YmRhMzZmNWJkYWM0MmI0OWRhN2VmODZjMmYxYjA5NDM3NQ==
5
+ data.tar.gz: !binary |-
6
+ NGYzZGVhY2RkZjM3NzRiNzdmZWRjZmQ0NTNiNTZjNzNlZDRmMDA3OQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ Y2QwZjVkN2FiMjA4YWZiZGFjZjkxNmY3ZjU1MWY1ZDdhZDBhMWM2MDYxNmVm
10
+ NjExMTFiMDJjZDliMDVlNjc5YTYyZDQ1NjU2ZDU1OWJiMmIwNmIyNTk5MGIx
11
+ YzRkYzE0YTg5NmFkN2U2OTcwNzEwMGZjMjc1ZWJmNGQ4ZTQ4YTI=
12
+ data.tar.gz: !binary |-
13
+ OTRjMGNjZTJmODI5YWMyMjY5ZWI3MzMyZWJiNjg1OWE5NjdmZWYyYzQ2NGU5
14
+ M2NkMzYxZmZjMWY1ZjE0NmVmZDhkYjk0OTk3ODBlMzI2NGJjNzI4ZTVlNTRl
15
+ Y2ViNzAzNjAyNzM1MTU1ZjgyNzFmYTQ0NjhlYzZiZDc1ZTc4MjQ=
data/bin/opsicle CHANGED
@@ -29,8 +29,15 @@ pre do |global_options, command, options, args|
29
29
  end
30
30
 
31
31
  on_error do |exception|
32
- exit(0) if exception.is_a?(Opsicle::Monitor::QuitMonitor)
33
- true
32
+ case exception
33
+ when Opsicle::Monitor::QuitMonitor
34
+ exit 0
35
+ when Opsicle::Errors::DeployFailed
36
+ Opsicle::Output.say exception.message, :error
37
+ false
38
+ else
39
+ true
40
+ end
34
41
  end
35
42
 
36
43
  desc "Deploy your current app to the given environment stack"
@@ -39,6 +46,7 @@ command :deploy do |c|
39
46
  c.switch [:b, :browser], :desc => "Open the OpsWorks deployments screen for this stack on deploy"
40
47
  c.switch [:g, :migrate], :desc => "Deploy with migrations"
41
48
  c.switch [:m, :monitor], :desc => "Run the Stack Monitor on deploy", :default_value => true
49
+ c.switch [:t, :track], :desc => "Tracks to deploy and exits when completed. Exits with non-zero if the deploy fails."
42
50
  c.action do |global_options, options, args|
43
51
  raise ArgumentError, 'You must specify an environment' unless args.first
44
52
  Opsicle::Deploy.new(args.first).execute global_options.merge(options)
@@ -121,6 +129,7 @@ desc "Update the Stack Custom Chef Cookbooks"
121
129
  arg_name '<environment>'
122
130
  command 'chef-update' do |c|
123
131
  c.switch [:m, :monitor], :desc => "Run the Stack Monitor on deploy", :default_value => true
132
+ c.switch [:t, :track], :desc => "Tracks to deploy and exits when completed. Exits with non-zero if the deploy fails."
124
133
  c.flag [:path],
125
134
  :desc => "Path to the directory of chef cookbooks to be uploaded to s3",
126
135
  :default_value => "cookbooks"
@@ -138,6 +147,7 @@ arg_name '<environment>'
138
147
  arg_name '<recipe>'
139
148
  command 'execute-recipes' do |c|
140
149
  c.switch [:m, :monitor], :desc => "Run the Stack Monitor on deploy", :default_value => true
150
+ c.switch [:t, :track], :desc => "Tracks to deploy and exits when completed. Exits with non-zero if the deploy fails."
141
151
  c.flag [:r, :recipes], :desc => 'The recipes to execute', :type => Array, :required => true
142
152
  c.flag [:i, :instance_ids], :desc => 'The specific instances to execute recipes on', :type => Array
143
153
  c.flag [:l, :layers], :desc => 'The specific layers to execute recipes on', :type => Array
@@ -6,7 +6,7 @@ module Opsicle
6
6
  open_deploy(response[:deployment_id])
7
7
  elsif options[:monitor] # Default option
8
8
  Output.say_verbose "Starting Stack Monitor..."
9
- @monitor = Opsicle::Monitor::App.new(@environment, options)
9
+ @monitor = Opsicle::Monitor::App.new(@environment, parse_options(response, options))
10
10
  @monitor.start
11
11
  end
12
12
  end
@@ -20,5 +20,16 @@ module Opsicle
20
20
  Output.say "Deploy failed. No deployment_id was received from OpsWorks", :error
21
21
  end
22
22
  end
23
+
24
+ private
25
+
26
+ def parse_options(response, options)
27
+ if options[:track]
28
+ options.delete(:track)
29
+ options[:deployment_id] = response[:deployment_id]
30
+ end
31
+
32
+ options
33
+ end
23
34
  end
24
35
  end
@@ -0,0 +1,24 @@
1
+ require 'gli/exceptions'
2
+
3
+ module Opsicle
4
+ module Errors
5
+
6
+ class DeployFailed < StandardError
7
+ def initialize(command=nil)
8
+ @command = command
9
+ super("#{command_string} failed!")
10
+ end
11
+
12
+ def command_string
13
+ command_string = @command ? @command[:name] : 'deploy'
14
+
15
+ if command_string == 'execute_recipes' && @command[:args]["recipes"]
16
+ command_string += " (running [#{@command[:args]["recipes"].join(', ')}])"
17
+ end
18
+
19
+ command_string
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -4,6 +4,7 @@
4
4
  # His help in working with the Ruby curses library has been invaluable - thanks tiredpixel!
5
5
 
6
6
  require 'opsicle/client'
7
+ require "opsicle/deployment"
7
8
 
8
9
  module Opsicle
9
10
  module Monitor
@@ -13,18 +14,22 @@ module Opsicle
13
14
 
14
15
  attr_reader :running
15
16
  attr_reader :restarting
17
+ attr_reader :deployment_id
18
+ attr_reader :deploy
16
19
 
17
20
  class << self
18
21
  attr_accessor :client
19
22
  end
20
23
 
21
24
  def initialize(environment, options)
22
- @running = false
23
- @restarting = false
24
- @threads = {}
25
+ @running = false
26
+ @restarting = false
27
+ @threads = {}
28
+ @deployment_id = options[:deployment_id]
25
29
 
26
30
  # Make client with correct configuration available to monitor spies
27
31
  App.client = Client.new(environment)
32
+ @deploy = Opsicle::Deployment.new(@deployment_id, App.client) if @deployment_id
28
33
  end
29
34
 
30
35
  def start
@@ -45,18 +50,25 @@ module Opsicle
45
50
  refresh_data_loop # refresh not so frequently
46
51
  end
47
52
 
53
+ if @deploy
54
+ @threads[:check_status] ||= Thread.new do
55
+ refresh_deploy_status_loop # refresh not so frequently
56
+ end
57
+ end
58
+
48
59
  @threads.each { |tname, t| t.join }
49
60
  ensure
50
61
  cleanup
51
62
  end
52
63
  end
53
64
 
54
- def stop
65
+ def stop(error=nil)
55
66
  @running = false
67
+ wakey_wakey
56
68
  @screen.close
57
69
  @screen = nil # Ruby curses lib doesn't have closed?(), so we set to nil, just in case
58
70
 
59
- raise QuitMonitor
71
+ raise (error || QuitMonitor)
60
72
  end
61
73
 
62
74
  def restart
@@ -140,10 +152,30 @@ module Opsicle
140
152
  end
141
153
  end
142
154
 
155
+ # This is an optional loop that is meant for keeping track of a deploy
156
+ # and exiting on completion. It uses it's own API call since digging down
157
+ # to the spies would get ugly.
158
+ def refresh_deploy_status_loop
159
+ while @running do
160
+ next unless @screen # HACK: only certain test scenarios?
161
+
162
+ check_deploy_status
163
+
164
+ sleep API_POLLING_INTERVAL
165
+ end
166
+ end
167
+
168
+ def check_deploy_status
169
+ unless deploy.running?
170
+ deploy.failed? ? stop(Opsicle::Errors::DeployFailed.new(deploy.command)) : stop
171
+ end
172
+ end
173
+
143
174
  def open_opsworks_browser
144
175
  %x(open 'https://console.aws.amazon.com/opsworks/home?#/stack/#{App.client.config.opsworks_config[:stack_id]}')
145
176
  end
146
177
  end
147
- QuitMonitor = Class.new(StandardError)
178
+
179
+ QuitMonitor = Class.new(StandardError)
148
180
  end
149
181
  end
@@ -1,3 +1,3 @@
1
1
  module Opsicle
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
data/lib/opsicle.rb CHANGED
@@ -4,6 +4,7 @@ Signal.trap("INT") do
4
4
  exit 1
5
5
  end
6
6
 
7
+ require "opsicle/errors"
7
8
  require "opsicle/output"
8
9
  require "opsicle/version"
9
10
  require "opsicle/commands"
@@ -78,6 +78,16 @@ module Opsicle
78
78
 
79
79
  subject.execute
80
80
  end
81
+
82
+ it "can exit on completion" do
83
+ allow(subject).to receive(:tar_cookbooks)
84
+ allow(subject).to receive(:s3_upload)
85
+ allow(subject).to receive(:cleanup_tar)
86
+ allow(subject).to receive(:update_custom_cookbooks).and_return({:deployment_id => 123})
87
+ expect(Monitor::App).to receive(:new).with('derp', :monitor => true, :deployment_id => 123)
88
+
89
+ subject.execute({:monitor => true, :track => true})
90
+ end
81
91
  end
82
92
 
83
93
  context "#tar_cookbooks" do
@@ -22,11 +22,19 @@ module Opsicle
22
22
  it "creates a new deployment and opens stack monitor" do
23
23
  expect(client).to receive(:run_command).with('deploy', {}).and_return({deployment_id: 'derp'})
24
24
  expect(subject).to_not receive(:open_deploy)
25
- expect(Monitor::App).to receive(:new)
25
+ expect(Monitor::App).to receive(:new).with('derp', :monitor => true)
26
26
 
27
27
  subject.execute
28
28
  end
29
29
 
30
+ it "creates a new deployment that exits the stack monitor on completion" do
31
+ expect(client).to receive(:run_command).with('deploy', {}).and_return({deployment_id: 'derp'})
32
+ expect(subject).to_not receive(:open_deploy)
33
+ expect(Monitor::App).to receive(:new).with('derp', :monitor => true, :deployment_id => 'derp')
34
+
35
+ subject.execute({:monitor => true, :track => true})
36
+ end
37
+
30
38
  it "creates a new deployment with migrations" do
31
39
  expect(client).to receive(:run_command).with('deploy', {"migrate"=>["true"]}).and_return({deployment_id: 'derp'})
32
40
  expect(subject).to_not receive(:open_deploy)
@@ -23,11 +23,19 @@ module Opsicle
23
23
  it "creates a new execute_recipes deployment and opens stack monitor" do
24
24
  expect(client).to receive(:run_command).with('execute_recipes', {"recipes" => ['herp']}, {}).and_return({deployment_id: 'derp'})
25
25
  expect(subject).to_not receive(:open_deploy)
26
- expect(Monitor::App).to receive(:new)
26
+ expect(Monitor::App).to receive(:new).with('derp', monitor: true, recipes: recipes)
27
27
 
28
28
  subject.execute({ monitor: true, recipes: recipes })
29
29
  end
30
30
 
31
+ it "creates a new execute_recipes deployment that exits the stack monitor on completion" do
32
+ expect(client).to receive(:run_command).with('execute_recipes', {"recipes" => ['herp']}, {}).and_return({deployment_id: 'derp'})
33
+ expect(subject).to_not receive(:open_deploy)
34
+ expect(Monitor::App).to receive(:new).with('derp', monitor: true, recipes: recipes, deployment_id: 'derp')
35
+
36
+ subject.execute({monitor: true, track: true, recipes: recipes})
37
+ end
38
+
31
39
  context "multiple recipes" do
32
40
  let(:recipes) { ['herp', 'flurp'] }
33
41
  it "creates a new execute_recipes deployment with multiple recipes" do
@@ -0,0 +1,60 @@
1
+ require "spec_helper"
2
+ require "opsicle"
3
+
4
+ module Opsicle
5
+ module Errors
6
+
7
+ describe DeployFailed do
8
+ let(:deploy) { {:name=>"deploy"} }
9
+
10
+ it "set's it default message to 'deploy failed!'" do
11
+ expect(subject.message).to eq('deploy failed!')
12
+ end
13
+
14
+ context "with a custom command passed in" do
15
+ let(:deploy) { {:name => "update_custom_cookbooks"} }
16
+ subject { DeployFailed.new(deploy) }
17
+
18
+ it "updates the error message" do
19
+ expect(subject.message).to eq('update_custom_cookbooks failed!')
20
+ end
21
+ end
22
+
23
+ context "with an execute_recipes command passed in" do
24
+ let(:deploy) { {:name => "execute_recipes", :args=>{"recipes"=>["app-configs", "deploy::default"]}} }
25
+ subject { DeployFailed.new(deploy) }
26
+
27
+ it "updates the error message" do
28
+ expect(subject.message).to eq('execute_recipes (running [app-configs, deploy::default]) failed!')
29
+ end
30
+ end
31
+
32
+ describe "#command_string" do
33
+ context "if @command is nil" do
34
+ it "returns 'deploy' if command is nil" do
35
+ expect(subject.command_string).to eq('deploy')
36
+ end
37
+ end
38
+
39
+ context "if @command is update_custom_cookbooks" do
40
+ let(:deploy) { {:name => "update_custom_cookbooks"} }
41
+ subject { DeployFailed.new deploy }
42
+
43
+ it "returns 'update_custom_cookbooks'" do
44
+ expect(subject.command_string).to eq('update_custom_cookbooks')
45
+ end
46
+ end
47
+
48
+ context "if @command is execute_recipes" do
49
+ let(:deploy) { {:name => "execute_recipes", :args=>{"recipes"=>["app-configs", "deploy::default"]}} }
50
+ subject { DeployFailed.new deploy }
51
+
52
+ it "returns 'execute_recipes (running [app-configs, deploy::default])'" do
53
+ expect(subject.command_string).to eq('execute_recipes (running [app-configs, deploy::default])')
54
+ end
55
+ end
56
+ end
57
+ end
58
+
59
+ end
60
+ end
@@ -20,12 +20,30 @@ describe Opsicle::Monitor::App do
20
20
  @app = Opsicle::Monitor::App.new("staging", {})
21
21
  end
22
22
 
23
- it "sets status not-running" do
24
- expect(@app.running).to equal(false)
25
- end
23
+ describe "#initialize" do
24
+
25
+ it "sets status not-running" do
26
+ expect(@app.running).to equal(false)
27
+ end
28
+
29
+ it "sets status not-restarting" do
30
+ expect(@app.restarting).to equal(false)
31
+ end
32
+
33
+ context "when the app is montoring a deploy" do
34
+ before do
35
+ @app = Opsicle::Monitor::App.new("staging", {:deployment_id => 123})
36
+ end
37
+
38
+ it "set the deployment_id" do
39
+ expect(@app.deployment_id).to equal(123)
40
+ end
41
+
42
+ it "assigns a deploy" do
43
+ expect(@app.deploy).to be_an_instance_of(Opsicle::Deployment)
44
+ end
45
+ end
26
46
 
27
- it "sets status not-restarting" do
28
- expect(@app.restarting).to equal(false)
29
47
  end
30
48
 
31
49
  describe "#restart" do
@@ -40,6 +58,31 @@ describe Opsicle::Monitor::App do
40
58
  end
41
59
  end
42
60
 
61
+ describe "#stop" do
62
+ before do
63
+ @app.instance_variable_set(:@running, true)
64
+ @app.instance_variable_set(:@screen, @screen)
65
+ end
66
+
67
+ it "sets @running to false" do
68
+ @app.stop rescue nil # don't care about the error here
69
+ expect(@app.running).to eq(false)
70
+ end
71
+
72
+ context "when called normally" do
73
+ it "raises QuitMonitor and exits safely" do
74
+ expect { @app.stop }.to raise_error(Opsicle::Monitor::QuitMonitor)
75
+ end
76
+ end
77
+
78
+ context "when a custom error is passed in" do
79
+ it "raises the custom error" do
80
+ MyAwesomeCustomError = Class.new(StandardError)
81
+ expect { @app.stop(MyAwesomeCustomError) }.to raise_error(MyAwesomeCustomError)
82
+ end
83
+ end
84
+ end
85
+
43
86
  describe "#do_command" do
44
87
  before do
45
88
  @app.instance_variable_set(:@running, true)
@@ -59,4 +102,43 @@ describe Opsicle::Monitor::App do
59
102
  end
60
103
  end
61
104
 
105
+ describe "#check_deploy_status" do
106
+ let(:deploy) { Opsicle::Deployment.new('derp', 'client') }
107
+ let(:deployment) { double("deployment", :[] => 'running') }
108
+
109
+ before do
110
+ allow(deploy).to receive(:deployment).and_return(deployment)
111
+ allow(deploy).to receive(:command).and_return({:name => 'deploy' })
112
+ @app = Opsicle::Monitor::App.new("staging", {:deployment_id => 123})
113
+ @app.instance_variable_set :@deploy, deploy
114
+ end
115
+
116
+ context "if the deploy is still running" do
117
+ it "does not stop the monitor" do
118
+ expect(@app).to receive(:stop).never
119
+ @app.send :check_deploy_status
120
+ end
121
+ end
122
+
123
+ context "if is finished running" do
124
+ context "and ran successfully" do
125
+ let(:deployment) { double("deployment", :[] => 'successful') }
126
+
127
+ it "stops the monitor normally" do
128
+ expect(@app).to receive(:stop).with(no_args)
129
+ @app.send :check_deploy_status
130
+ end
131
+ end
132
+
133
+ context "and failed" do
134
+ let(:deployment) { double("deployment", :[] => 'failed') }
135
+
136
+ it "stops the monitor with an DeployFailed error" do
137
+ expect(@app).to receive(:stop).with(Opsicle::Errors::DeployFailed)
138
+ @app.send :check_deploy_status
139
+ end
140
+ end
141
+ end
142
+ end
143
+
62
144
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsicle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
5
- prerelease:
4
+ version: 0.7.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andy Fleener
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-09-19 00:00:00.000000000 Z
12
+ date: 2014-11-06 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: aws-sdk
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ~>
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
@@ -31,7 +28,6 @@ dependencies:
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: gli
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
32
  - - ~>
37
33
  - !ruby/object:Gem::Version
@@ -39,7 +35,6 @@ dependencies:
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
39
  - - ~>
45
40
  - !ruby/object:Gem::Version
@@ -47,7 +42,6 @@ dependencies:
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: highline
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
46
  - - ~>
53
47
  - !ruby/object:Gem::Version
@@ -55,7 +49,6 @@ dependencies:
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
53
  - - ~>
61
54
  - !ruby/object:Gem::Version
@@ -63,7 +56,6 @@ dependencies:
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: terminal-table
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
60
  - - ~>
69
61
  - !ruby/object:Gem::Version
@@ -71,7 +63,6 @@ dependencies:
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
67
  - - ~>
77
68
  - !ruby/object:Gem::Version
@@ -79,7 +70,6 @@ dependencies:
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: minitar
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
74
  - - ~>
85
75
  - !ruby/object:Gem::Version
@@ -87,7 +77,6 @@ dependencies:
87
77
  type: :runtime
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
81
  - - ~>
93
82
  - !ruby/object:Gem::Version
@@ -95,7 +84,6 @@ dependencies:
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: bundler
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
88
  - - ~>
101
89
  - !ruby/object:Gem::Version
@@ -103,7 +91,6 @@ dependencies:
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
95
  - - ~>
109
96
  - !ruby/object:Gem::Version
@@ -111,7 +98,6 @@ dependencies:
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: rake
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
102
  - - ~>
117
103
  - !ruby/object:Gem::Version
@@ -119,7 +105,6 @@ dependencies:
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
109
  - - ~>
125
110
  - !ruby/object:Gem::Version
@@ -127,7 +112,6 @@ dependencies:
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: rspec
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
116
  - - ~>
133
117
  - !ruby/object:Gem::Version
@@ -135,7 +119,6 @@ dependencies:
135
119
  type: :development
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
123
  - - ~>
141
124
  - !ruby/object:Gem::Version
@@ -143,7 +126,6 @@ dependencies:
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: guard
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
130
  - - ~>
149
131
  - !ruby/object:Gem::Version
@@ -151,7 +133,6 @@ dependencies:
151
133
  type: :development
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
137
  - - ~>
157
138
  - !ruby/object:Gem::Version
@@ -159,7 +140,6 @@ dependencies:
159
140
  - !ruby/object:Gem::Dependency
160
141
  name: guard-rspec
161
142
  requirement: !ruby/object:Gem::Requirement
162
- none: false
163
143
  requirements:
164
144
  - - ~>
165
145
  - !ruby/object:Gem::Version
@@ -167,7 +147,6 @@ dependencies:
167
147
  type: :development
168
148
  prerelease: false
169
149
  version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
150
  requirements:
172
151
  - - ~>
173
152
  - !ruby/object:Gem::Version
@@ -180,18 +159,7 @@ executables:
180
159
  extensions: []
181
160
  extra_rdoc_files: []
182
161
  files:
183
- - .gitignore
184
- - .octopolo.yml
185
- - .rspec
186
- - .ruby-gemset
187
- - .ruby-version
188
- - .travis.yml
189
- - CHANGELOG.markdown
190
- - Gemfile
191
- - Guardfile
192
162
  - LICENSE
193
- - README.markdown
194
- - Rakefile
195
163
  - bin/opsicle
196
164
  - lib/opsicle.rb
197
165
  - lib/opsicle/client.rb
@@ -207,6 +175,7 @@ files:
207
175
  - lib/opsicle/deploy_helper.rb
208
176
  - lib/opsicle/deployment.rb
209
177
  - lib/opsicle/deployments.rb
178
+ - lib/opsicle/errors.rb
210
179
  - lib/opsicle/instances.rb
211
180
  - lib/opsicle/layer.rb
212
181
  - lib/opsicle/monitor.rb
@@ -226,7 +195,6 @@ files:
226
195
  - lib/opsicle/s3_bucket.rb
227
196
  - lib/opsicle/stack.rb
228
197
  - lib/opsicle/version.rb
229
- - opsicle.gemspec
230
198
  - spec/opsicle/client_spec.rb
231
199
  - spec/opsicle/commands/chef_update_spec.rb
232
200
  - spec/opsicle/commands/deploy_spec.rb
@@ -236,6 +204,7 @@ files:
236
204
  - spec/opsicle/commands/ssh_key_spec.rb
237
205
  - spec/opsicle/commands/ssh_spec.rb
238
206
  - spec/opsicle/config_spec.rb
207
+ - spec/opsicle/errors_spec.rb
239
208
  - spec/opsicle/layer_spec.rb
240
209
  - spec/opsicle/monitor/app_spec.rb
241
210
  - spec/opsicle/monitor/panel_spec.rb
@@ -247,27 +216,26 @@ files:
247
216
  homepage: https://github.com/sportngin/opsicle
248
217
  licenses:
249
218
  - MIT
219
+ metadata: {}
250
220
  post_install_message:
251
221
  rdoc_options: []
252
222
  require_paths:
253
223
  - lib
254
224
  required_ruby_version: !ruby/object:Gem::Requirement
255
- none: false
256
225
  requirements:
257
226
  - - ! '>='
258
227
  - !ruby/object:Gem::Version
259
228
  version: '0'
260
229
  required_rubygems_version: !ruby/object:Gem::Requirement
261
- none: false
262
230
  requirements:
263
231
  - - ! '>='
264
232
  - !ruby/object:Gem::Version
265
233
  version: '0'
266
234
  requirements: []
267
235
  rubyforge_project:
268
- rubygems_version: 1.8.25
236
+ rubygems_version: 2.2.2
269
237
  signing_key:
270
- specification_version: 3
238
+ specification_version: 4
271
239
  summary: An opsworks specific abstraction on top of the aws sdk
272
240
  test_files:
273
241
  - spec/opsicle/client_spec.rb
@@ -279,6 +247,7 @@ test_files:
279
247
  - spec/opsicle/commands/ssh_key_spec.rb
280
248
  - spec/opsicle/commands/ssh_spec.rb
281
249
  - spec/opsicle/config_spec.rb
250
+ - spec/opsicle/errors_spec.rb
282
251
  - spec/opsicle/layer_spec.rb
283
252
  - spec/opsicle/monitor/app_spec.rb
284
253
  - spec/opsicle/monitor/panel_spec.rb
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- # ignore .opsicle since this will never be hosted on OpsWorks
2
- .opsicle*
3
- *.gem
4
- *.rbc
5
- .bundle
6
- .config
7
- coverage
8
- Gemfile.lock
9
- InstalledFiles
10
- lib/bundler/man
11
- pkg
12
- rdoc
13
- spec/reports
14
- test/tmp
15
- test/version_tmp
16
- tmp
17
-
18
- # YARD artifacts
19
- .yardoc
20
- _yardoc
21
- doc/
data/.octopolo.yml DELETED
@@ -1,4 +0,0 @@
1
- github_repo: sportngin/opsicle
2
- semantic_versioning: true
3
- branches_to_keep:
4
- - master
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- opsicle
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-1.9.3-p429
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0
4
- - 2.1
5
- - 1.9.3
6
- script: bundle exec rspec
7
- matrix:
8
- include:
9
- - rvm: jruby-19mode # JRuby in 1.9 mode
10
- env: JRUBY_OPTS="--1.9 -Xcext.enabled=true"
11
- allow_failures:
12
- - rvm: jruby-19mode
data/CHANGELOG.markdown DELETED
@@ -1,5 +0,0 @@
1
- #### v0.7.0
2
- * changed it to execute recipes on all instances in a layer
3
-
4
- > Elliot Hursh: Andy Fleener, Nick LaMuro: https://github.com/sportngin/opsicle/pull/62
5
-
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in opsicle.gemspec
4
- gemspec
5
-
6
- gem 'curses' if RUBY_VERSION >= '2.1' || RUBY_PLATFORM == 'java'
7
-
data/Guardfile DELETED
@@ -1,5 +0,0 @@
1
- guard :rspec, cmd: 'bundle exec rspec', all_on_start: true, all_after_pass: true do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec" }
5
- end
data/README.markdown DELETED
@@ -1,104 +0,0 @@
1
- #Opsicle, an OpsWorks CLI
2
- A gem bringing the glory of OpsWorks to your command line.
3
-
4
- [![Gem Version](https://badge.fury.io/rb/opsicle.png)](http://badge.fury.io/rb/opsicle)
5
- [![Build Status](https://travis-ci.org/sportngin/opsicle.png?branch=master)](https://travis-ci.org/sportngin/opsicle)
6
-
7
- ## Installation
8
- Add this line to your project's Gemfile:
9
-
10
- **For Ruby >=2.1.0**
11
-
12
- ```ruby
13
- gem 'opsicle'
14
- gem 'curses'
15
- ```
16
-
17
- **For Ruby <2.1.0, 1.9.3**
18
-
19
- ```ruby
20
- gem 'opsicle'
21
- ```
22
-
23
- (Alternatively, `gem 'opsicle'; gem 'curses' unless RUBY_VERSION < "2.1.0"`)
24
-
25
- **Why the extra `curses` gem for Ruby 2.1.0+?**
26
- Opsicle uses [curses](http://en.wikipedia.org/wiki/Curses_(programming_library)).
27
- Ruby's library to interface with curses was [removed from stdlib in Ruby 2.1.0](https://bugs.ruby-lang.org/issues/8584).
28
- [The new curses gem](https://github.com/ruby/curses) is not backwards compatible, so in an effort to keep this gem
29
- friendly with all current Ruby versions we don't list it as a dependency in Opsicle's gemspec - doing so would cause
30
- errors for Ruby 1.9.3 users.
31
- Ruby >=2.1.0 will likely be enforced sometime in 2014; [certainly by February 2015](https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/).
32
-
33
- ### Set up an Application to use opsicle
34
-
35
- ```yaml
36
- # your_app_root/.opsicle
37
-
38
- staging:
39
- stack_id: opsworks-stack-id
40
- app_id: opsworks-app-id
41
- production:
42
- stack_id: opsworks-stack-id
43
- app_id: opsworks-app-id
44
- ```
45
-
46
- ```yaml
47
- # ~/.fog
48
-
49
- staging:
50
- aws_access_key_id: YOUR_AWS_ACCESS_KEY
51
- aws_secret_access_key: YOUR_AWS_SECRET_ACCESS_KEY
52
- production:
53
- aws_access_key_id: YOUR_AWS_ACCESS_KEY
54
- aws_secret_access_key: YOUR_AWS_SECRET_ACCESS_KEY
55
- ```
56
-
57
- ## Using Opsicle
58
-
59
- Run `opsicle help` for a full list of commands and their uses.
60
- Some common commands:
61
-
62
- ### Deployments
63
- ```bash
64
-
65
- # Run a basic deploy for the current app
66
- opsicle deploy staging
67
-
68
- # Run the deploy for production
69
- opsicle deploy production
70
-
71
- ```
72
- By default, deploying opens the Opsicle Stack Monitor.
73
- You may also use `--browser` to open the OpsWorks deployments screen instead,
74
- or `--no-monitor` to ignore both monitoring options
75
-
76
- ### SSH
77
- ```bash
78
- # SSH to a server instance in the given environment stack
79
- opsicle ssh staging
80
-
81
- # Set your user SSH key (PUBLIC KEY) for OpsWorks
82
- opsicle ssh-key staging <key-file>
83
-
84
- ```
85
-
86
- ### Stack Monitor
87
- ```bash
88
- # Launch the Opsicle Stack Monitor for the given environment stack
89
- opsicle monitor staging
90
-
91
- ```
92
- ### Updating Custom Chef Recipes
93
- ```bash
94
- # Upload a cookbooks directory to S3 and update the stack's custom cookbooks
95
- opsicle chef-update staging --bucket-name my-opsworks-cookbooks
96
-
97
- ```
98
- This command accepts a --path argument to the directory of cookbooks to upload. It defaults to 'cookbooks'.
99
- It also accepts a --bucket-name for the base s3 bucket. This flag is required.
100
-
101
-
102
- Opsicle accepts a `--verbose` flag or the VERBOSE environment variable to show additional information as commands are run.
103
-
104
- Opsicle accepts a DEBUG environment variable to show additional logging such as stack traces for failed commands.
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
data/opsicle.gemspec DELETED
@@ -1,32 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'opsicle/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "opsicle"
8
- spec.version = Opsicle::VERSION
9
- spec.authors = ["Andy Fleener", "Nick LaMuro"]
10
- spec.email = ["andrew.fleener@sportngin.com"]
11
- spec.description = %q{CLI for the opsworks platform}
12
- spec.summary = %q{An opsworks specific abstraction on top of the aws sdk}
13
- spec.homepage = "https://github.com/sportngin/opsicle"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency "aws-sdk", "~> 1.30"
22
- spec.add_dependency "gli", "~> 2.9"
23
- spec.add_dependency "highline", "~> 1.6"
24
- spec.add_dependency "terminal-table", "~> 1.4"
25
- spec.add_dependency "minitar", "~> 0.5"
26
-
27
- spec.add_development_dependency "bundler", "~> 1.3"
28
- spec.add_development_dependency "rake", "~> 10.1"
29
- spec.add_development_dependency "rspec", "~> 3.0.0.beta2"
30
- spec.add_development_dependency "guard", "~> 2.5"
31
- spec.add_development_dependency "guard-rspec", "~> 4.2"
32
- end