engineyard-serverside-adapter 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,7 @@ module EY
10
10
  autoload :DisableMaintenancePage, 'engineyard-serverside-adapter/disable_maintenance_page'
11
11
  autoload :EnableMaintenancePage, 'engineyard-serverside-adapter/enable_maintenance_page'
12
12
  autoload :Integrate, 'engineyard-serverside-adapter/integrate'
13
+ autoload :Restart, 'engineyard-serverside-adapter/restart'
13
14
  autoload :Rollback, 'engineyard-serverside-adapter/rollback'
14
15
  autoload :VERSION, 'engineyard-serverside-adapter/version'
15
16
 
@@ -38,6 +39,10 @@ module EY
38
39
  Integrate.new(new_action_args, &b)
39
40
  end
40
41
 
42
+ def restart(&b)
43
+ Restart.new(new_action_args, &b)
44
+ end
45
+
41
46
  def rollback(&b)
42
47
  Rollback.new(new_action_args, &b)
43
48
  end
@@ -0,0 +1,20 @@
1
+ module EY
2
+ module Serverside
3
+ class Adapter
4
+ class Restart < Action
5
+
6
+ option :app, :string, :required => true
7
+ option :instances, :instances, :required => true
8
+ option :stack, :string, :required => true
9
+ option :verbose, :boolean
10
+
11
+ private
12
+
13
+ def task
14
+ ['restart']
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,7 +1,7 @@
1
1
  module EY
2
2
  module Serverside
3
3
  class Adapter
4
- VERSION = "1.3.2"
4
+ VERSION = "1.3.3"
5
5
  end
6
6
  end
7
7
  end
@@ -92,6 +92,7 @@ describe EY::Serverside::Adapter do
92
92
  :disable_maintenance_page,
93
93
  :enable_maintenance_page,
94
94
  :integrate,
95
+ :restart,
95
96
  :rollback,
96
97
  ].each do |method|
97
98
  context "##{method}" do
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe EY::Serverside::Adapter::Restart do
4
+ it_should_behave_like "it installs engineyard-serverside"
5
+
6
+ it_should_behave_like "it accepts app"
7
+ it_should_behave_like "it accepts instances"
8
+ it_should_behave_like "it accepts stack"
9
+ it_should_behave_like "it accepts verbose"
10
+
11
+ it_should_require :app
12
+ it_should_require :instances
13
+ it_should_require :stack
14
+
15
+ context "with valid arguments" do
16
+ let(:command) do
17
+ adapter = described_class.new do |arguments|
18
+ arguments.app = "rackapp"
19
+ arguments.instances = [{:hostname => 'localhost', :roles => %w[han solo], :name => 'chewie'}]
20
+ arguments.stack = "nginx_unicorn"
21
+ end
22
+ last_command(adapter)
23
+ end
24
+
25
+ it "invokes exactly the right command" do
26
+ command.should == "engineyard-serverside _#{EY::Serverside::Adapter::VERSION}_ restart --app rackapp --instance-names localhost:chewie --instance-roles localhost:han,solo --instances localhost --stack nginx_unicorn"
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 2
10
- version: 1.3.2
9
+ - 3
10
+ version: 1.3.3
11
11
  platform: ruby
12
12
  authors: []
13
13
 
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-15 00:00:00 -07:00
18
+ date: 2010-09-16 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -104,6 +104,7 @@ files:
104
104
  - lib/engineyard-serverside-adapter/disable_maintenance_page.rb
105
105
  - lib/engineyard-serverside-adapter/enable_maintenance_page.rb
106
106
  - lib/engineyard-serverside-adapter/integrate.rb
107
+ - lib/engineyard-serverside-adapter/restart.rb
107
108
  - lib/engineyard-serverside-adapter/rollback.rb
108
109
  - lib/engineyard-serverside-adapter/version.rb
109
110
  - spec/adapter_spec.rb
@@ -112,6 +113,7 @@ files:
112
113
  - spec/disable_maintenance_page_spec.rb
113
114
  - spec/enable_maintenance_page_spec.rb
114
115
  - spec/integrate_spec.rb
116
+ - spec/restart_spec.rb
115
117
  - spec/rollback_spec.rb
116
118
  - spec/spec.opts
117
119
  - spec/spec_helper.rb