dumbwaiter 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/dumbwaiter/cli.rb +5 -0
- data/lib/dumbwaiter/deployment.rb +2 -2
- data/lib/dumbwaiter/stack.rb +2 -2
- data/lib/dumbwaiter/version.rb +1 -1
- data/spec/lib/dumbwaiter/cli_spec.rb +10 -7
- data/spec/lib/dumbwaiter/deployment_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4577f08a2e6de50e816eb41d34df1a9cdf899ba
|
4
|
+
data.tar.gz: 851c7468dfbbf4a81496e1236b7ef0db84c238a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f293f9c4c362a4b68a8d17bd2ea90c57862bf61ea844549dad0ee0b9b1f1e4e196d0a3242cd444c7acff393e4a7c410606fda097cad32ddac5d8a97d6720b8e
|
7
|
+
data.tar.gz: a31062467cee5a12324b454654774de259a99ab6ae0d28b55f7851f702f9fee8709e4aff21afeb32a5a8a0debe31a0b4e5d0833a7d38b28a9ddd06c13abea5ba
|
data/README.md
CHANGED
data/lib/dumbwaiter/cli.rb
CHANGED
@@ -37,5 +37,10 @@ module Dumbwaiter
|
|
37
37
|
rescue Dumbwaiter::Stack::NotFound => e
|
38
38
|
raise Thor::Error.new(e.message)
|
39
39
|
end
|
40
|
+
|
41
|
+
desc "stacks", "List all the stacks"
|
42
|
+
def stacks
|
43
|
+
Stack.all.each { |stack| Kernel.puts("#{stack.name}: #{stack.apps.map(&:name).join(', ')}") }
|
44
|
+
end
|
40
45
|
end
|
41
46
|
end
|
@@ -3,8 +3,8 @@ require "dumbwaiter/deployment_custom_json"
|
|
3
3
|
class Dumbwaiter::Deployment
|
4
4
|
attr_reader :opsworks_deployment
|
5
5
|
|
6
|
-
def self.all(
|
7
|
-
opsworks.describe_deployments(stack_id:
|
6
|
+
def self.all(stack, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
|
7
|
+
opsworks.describe_deployments(stack_id: stack.id).deployments.map { |d| new(d) }
|
8
8
|
end
|
9
9
|
|
10
10
|
def initialize(opsworks_deployment)
|
data/lib/dumbwaiter/stack.rb
CHANGED
@@ -30,10 +30,10 @@ class Dumbwaiter::Stack
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def apps
|
33
|
-
@apps ||= Dumbwaiter::App.all(
|
33
|
+
@apps ||= Dumbwaiter::App.all(self, opsworks)
|
34
34
|
end
|
35
35
|
|
36
36
|
def deployments
|
37
|
-
@deployments ||= Dumbwaiter::Deployment.all(
|
37
|
+
@deployments ||= Dumbwaiter::Deployment.all(self, opsworks)
|
38
38
|
end
|
39
39
|
end
|
data/lib/dumbwaiter/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Dumbwaiter::Cli do
|
4
|
-
let(:fake_stack) { double(:stack, name: "ducks", id: "wat") }
|
5
4
|
let(:fake_app) { double(:app, name: "reifel") }
|
5
|
+
let(:fake_stack) { double(:stack, name: "ducks", id: "wat", apps: [fake_app]) }
|
6
6
|
|
7
7
|
subject(:cli) { Dumbwaiter::Cli.new }
|
8
8
|
|
@@ -52,9 +52,7 @@ describe Dumbwaiter::Cli do
|
|
52
52
|
|
53
53
|
context "when the stack does not exist" do
|
54
54
|
it "blows up" do
|
55
|
-
expect {
|
56
|
-
cli.rollback("maple syrup", "reifel")
|
57
|
-
}.to raise_error(Thor::Error)
|
55
|
+
expect { cli.rollback("maple syrup", "reifel") }.to raise_error(Thor::Error)
|
58
56
|
end
|
59
57
|
end
|
60
58
|
end
|
@@ -93,10 +91,15 @@ describe Dumbwaiter::Cli do
|
|
93
91
|
|
94
92
|
context "when the stack does not exist" do
|
95
93
|
it "blows up" do
|
96
|
-
expect {
|
97
|
-
cli.list("wat")
|
98
|
-
}.to raise_error(Thor::Error)
|
94
|
+
expect { cli.list("wat") }.to raise_error(Thor::Error)
|
99
95
|
end
|
100
96
|
end
|
101
97
|
end
|
98
|
+
|
99
|
+
describe "#stacks" do
|
100
|
+
it "lists the stacks" do
|
101
|
+
Kernel.should_receive(:puts).with("ducks: reifel")
|
102
|
+
cli.stacks
|
103
|
+
end
|
104
|
+
end
|
102
105
|
end
|
@@ -37,9 +37,10 @@ describe Dumbwaiter::Deployment do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
describe ".all" do
|
40
|
+
let(:fake_stack) { double(:stack, id: "pancakes") }
|
40
41
|
it "fetches all the deployments" do
|
41
42
|
fake_opsworks.should_receive(:describe_deployments).with(stack_id: "pancakes")
|
42
|
-
Dumbwaiter::Deployment.all(
|
43
|
+
Dumbwaiter::Deployment.all(fake_stack, fake_opsworks).should have(1).app
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|