rubber 2.3.1 → 2.4.0

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.
@@ -94,5 +94,7 @@ local all postgres ident
94
94
  local all <%= rubber_env.db_user %> <%= scheme %>
95
95
  host all all 127.0.0.1/32 <%= scheme %>
96
96
  host all all ::1/128 <%= scheme %>
97
- host replication <%= rubber_env.db_replication_user %> 10.0.0.1/8 <%= scheme %>
98
- host all <%= rubber_env.db_user %> 10.0.0.1/8 <%= scheme %>
97
+
98
+ host replication <%= rubber_env.db_replication_user %> 10.0.0.1/8 <%= scheme %>
99
+ host all <%= rubber_env.db_user %> 10.0.0.1/8 <%= scheme %>
100
+ host all <%= rubber_env.db_user %> <%= rubber_instances[rubber_env.host].internal_ip %>/32 <%= scheme %>
@@ -26,7 +26,7 @@ class AwsTest < Test::Unit::TestCase
26
26
  end
27
27
 
28
28
  should "create instance" do
29
- assert @cloud.create_instance('', '', '', '')
29
+ assert @cloud.create_instance('', '', '', '', '')
30
30
  end
31
31
 
32
32
  end
@@ -0,0 +1,70 @@
1
+ require File.expand_path(File.join(__FILE__, '../..', 'test_helper'))
2
+ require 'rubber/cloud/digital_ocean'
3
+ require 'ostruct'
4
+
5
+ class DigitalOceanTest < Test::Unit::TestCase
6
+
7
+ context 'digital_ocean' do
8
+
9
+ setup do
10
+ env = {'client_key' => "XXX", 'api_key' => "YYY", 'region' => 'New York 1', 'key_file' => "#{File.dirname(__FILE__)}/../fixtures/basic/test.pem"}
11
+ env = Rubber::Configuration::Environment::BoundEnv.new(env, nil, nil, nil)
12
+ @cloud = Rubber::Cloud::DigitalOcean.new(env, nil)
13
+ end
14
+
15
+ should 'instantiate' do
16
+ assert @cloud.compute_provider
17
+ assert_nil @cloud.storage_provider
18
+ end
19
+
20
+ context '#create_instance' do
21
+ should 'create instance' do
22
+ assert @cloud.create_instance('my-instance', 'Ubuntu 12.04 x64 Server', '512MB', [], 'New York 1')
23
+ end
24
+
25
+ should 'raise error if invalid region' do
26
+ begin
27
+ @cloud.create_instance('my-instance', 'Ubuntu 12.04 x64 Server', '512MB', [], 'Mars 1')
28
+ rescue => e
29
+ assert_equal 'Invalid region for DigitalOcean: Mars 1', e.message
30
+ else
31
+ fail 'Did not raise exception for invalid region'
32
+ end
33
+ end
34
+
35
+ should 'raise an error if invalid image type' do
36
+ begin
37
+ @cloud.create_instance('my-instance', 'Ubuntu 12.04 x64 Server', 'm1.small', [], 'New York 1')
38
+ rescue => e
39
+ assert_equal 'Invalid image type for DigitalOcean: m1.small', e.message
40
+ else
41
+ fail 'Did not raise exception for invalid image type'
42
+ end
43
+ end
44
+
45
+ should 'raise an error if invalid image name' do
46
+ begin
47
+ @cloud.create_instance('my-instance', 'Windows Server 2003', '512MB', [], 'New York 1')
48
+ rescue => e
49
+ assert_equal 'Invalid image name for DigitalOcean: Windows Server 2003', e.message
50
+ else
51
+ fail 'Did not raise exception for invalid image name'
52
+ end
53
+ end
54
+
55
+ should 'raise an error if no remote SSH key and local key_file is bad' do
56
+ begin
57
+ env = {'client_key' => "XXX", 'api_key' => "YYY", 'region' => 'New York 1'}
58
+ env = Rubber::Configuration::Environment::BoundEnv.new(env, nil, nil, nil)
59
+ cloud = Rubber::Cloud::DigitalOcean.new(env, nil)
60
+
61
+ cloud.create_instance('my-instance', 'Ubuntu 12.04 x64 Server', '512MB', [], 'New York 1')
62
+ rescue => e
63
+ assert_equal 'Missing key_file for DigitalOcean', e.message
64
+ else
65
+ fail 'Did not raise exception for missing key_file'
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -7,7 +7,9 @@ class FogTest < Test::Unit::TestCase
7
7
  context "fog" do
8
8
 
9
9
  setup do
10
- env = {'credentials' =>
10
+ env = {'compute_credentials' =>
11
+ {'rackspace_api_key' => "XXX", 'rackspace_username' => "YYY", 'provider' => "rackspace"},
12
+ 'storage_credentials' =>
11
13
  {'rackspace_api_key' => "XXX", 'rackspace_username' => "YYY", 'provider' => "rackspace"}}
12
14
  env = Rubber::Configuration::Environment::BoundEnv.new(env, nil, nil, nil)
13
15
  @cloud = Rubber::Cloud::Fog.new(env, nil)
@@ -27,7 +29,7 @@ class FogTest < Test::Unit::TestCase
27
29
  end
28
30
 
29
31
  should "create instance" do
30
- assert @cloud.create_instance('', '', '', '')
32
+ assert @cloud.create_instance('', '', '', '', '')
31
33
  end
32
34
 
33
35
  end
@@ -0,0 +1 @@
1
+ ssh-dss AAAAB3NzaC1kc3MAAACBAJKDT7tweR6kJbNcarF4YUET4rXRfORYy1g2iVgi5EhegJQ2VnNYG71zWp2oL9+ZRwP3B2UQByS8/cQr6xNPtGLd8+VsFsWtl/sTYC/VytMnkTVu/SR0uwlHMwpgW1yutouwAqWvvS2B194tcfgX0ZFOuLUEnMCnAQ+sp4aJ2ItdAAAAFQDB1OMVVSjq1vqc9XcNbqNKzYRWVwAAAIEAkaGlXGvxJvThtjsRjqWg5uLk1PSP91tQwx78Cf+bErbYUynGvVeLk6M0OIed2ZCaGm9T9tzRSnLveJPV07a56O1iyZFdbQBnzjAQaSiFk6xs/glmjjRpe4Tmf5Y28L1gJYLwgGIN85KbyfqyTCAjJnPmlxEtKk35irocuZwRSggAAACAT8BsrVlVenuKfZQrXCwDl2PSaha55iyAJz7NxLM1I6URiX6TzUwkvCqzGOZwzpRGCB5fB/LpiUImeAre8WpfTBZr7cKffyljOTjZbHK2z10Po8Y5CJIvPLRpNzFRcnfKSbcX0l1pm3B11mC0WVJEaLx2LlKzioEuNxy0euooRZU= nirvdrum@rubber
@@ -75,5 +75,13 @@ class UtilTest < Test::Unit::TestCase
75
75
 
76
76
  end
77
77
 
78
+ context 'camelcase' do
79
+ should 'handle single words' do
80
+ assert_equal 'Aws', camelcase('aws')
81
+ end
78
82
 
83
+ should 'handle multiple words' do
84
+ assert_equal 'DigitalOcean', camelcase('digital_ocean')
85
+ end
86
+ end
79
87
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Conway
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-12 00:00:00.000000000 Z
12
+ date: 2013-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -211,8 +211,10 @@ files:
211
211
  - lib/rubber/cloud/aws.rb
212
212
  - lib/rubber/cloud/aws_table_store.rb
213
213
  - lib/rubber/cloud/base.rb
214
+ - lib/rubber/cloud/digital_ocean.rb
214
215
  - lib/rubber/cloud/fog.rb
215
216
  - lib/rubber/cloud/fog_storage.rb
217
+ - lib/rubber/cloud/generic.rb
216
218
  - lib/rubber/commands/config.rb
217
219
  - lib/rubber/commands/cron.rb
218
220
  - lib/rubber/commands/util.rb
@@ -605,6 +607,7 @@ files:
605
607
  - templates/zookeeper/templates.yml
606
608
  - test/cloud/aws_table_store_test.rb
607
609
  - test/cloud/aws_test.rb
610
+ - test/cloud/digital_ocean_test.rb
608
611
  - test/cloud/fog_storage_test.rb
609
612
  - test/cloud/fog_test.rb
610
613
  - test/command_test.rb
@@ -622,6 +625,7 @@ files:
622
625
  - test/fixtures/basic/role/role2/foo.conf
623
626
  - test/fixtures/basic/rubber-extra.yml
624
627
  - test/fixtures/basic/rubber.yml
628
+ - test/fixtures/basic/test.pem.pub
625
629
  - test/fixtures/expansion/rubber.yml
626
630
  - test/fixtures/generator_order/common/a_first.conf
627
631
  - test/fixtures/generator_order/common/z_last.conf
@@ -662,7 +666,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
662
666
  version: '0'
663
667
  requirements: []
664
668
  rubyforge_project: rubber
665
- rubygems_version: 2.0.0
669
+ rubygems_version: 2.0.2
666
670
  signing_key:
667
671
  specification_version: 4
668
672
  summary: A capistrano plugin for managing multi-instance deployments to the cloud