rubber 1.5.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 1.5.3
2
+ -----
3
+
4
+ Don't do a rake gems:install if bundler is in use. <511cac1> [Kevin Menard]
5
+ Don't require rubber to be used as a plugin for Rails 2. <60165e3> [Kevin Menard]
6
+
1
7
  1.5.2
2
8
  -----
3
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.3
1
+ 1.5.4
@@ -7,10 +7,10 @@ namespace :rubber do
7
7
  task :install_rvm do
8
8
  rubber.sudo_script "install_rvm", <<-ENDSCRIPT
9
9
  if [[ `rvm --version 2> /dev/null` == "" ]]; then
10
+ echo "rvm_prefix=/usr/local" > /etc/rvmrc
10
11
  wget -qNP /tmp http://rvm.beginrescueend.com/releases/rvm-install-head
11
12
  bash /tmp/rvm-install-head
12
13
  echo "#{rubber_env.rvm_prepare}" > /etc/profile.d/rvm.sh
13
- echo "rvm_prefix=/usr/local" > /etc/rvmrc
14
14
  fi
15
15
  ENDSCRIPT
16
16
  end
@@ -13,7 +13,7 @@ packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, z
13
13
 
14
14
  # REQUIRED: Set to the rvm version string for the ruby version you wish to use
15
15
  # Run "rvm list known" to see the list of possible options
16
- rvm_ruby: 1.9.2-head
16
+ rvm_ruby: 1.9.2
17
17
 
18
18
  # When rvm is installed as root, and you set the default, it symlinks ruby executables
19
19
  # into /usr/local
@@ -12,7 +12,7 @@ namespace :rubber do
12
12
  if [[ ! -d "#{rubber_env.cassandra_dir}" ]]; then
13
13
  wget -qNP /tmp #{rubber_env.cassandra_pkg_url}
14
14
  tar -C #{rubber_env.cassandra_prefix} -zxf /tmp/apache-cassandra-#{rubber_env.cassandra_version}-bin.tar.gz
15
- wget -nNO #{rubber_env.cassandra_dir}/jmxterm.jar http://downloads.sourceforge.net/project/cyclops-group/jmxterm/1.0-alpha-4/jmxterm-1.0-alpha-4-uber.jar
15
+ wget -qNO #{rubber_env.cassandra_dir}/jmxterm.jar http://downloads.sourceforge.net/project/cyclops-group/jmxterm/1.0-alpha-4/jmxterm-1.0-alpha-4-uber.jar
16
16
  fi
17
17
  ENDSCRIPT
18
18
  end
@@ -1,6 +1,6 @@
1
1
  passenger_version: 2.2.11
2
2
  passenger_root: "$GEM_HOME/gems/passenger-#{passenger_version}"
3
- passenger_ruby: "#{rvm_prefix}/bin/passenger_ruby"
3
+ passenger_ruby: "#{ruby_prefix}/bin/passenger_ruby"
4
4
  passenger_lib: "#{passenger_root}/ext/apache2/mod_passenger.so"
5
5
  passenger_listen_port: 7000
6
6
  passenger_listen_ssl_port: 7001
@@ -7,10 +7,10 @@ namespace :rubber do
7
7
  task :install_rvm do
8
8
  rubber.sudo_script "install_rvm", <<-ENDSCRIPT
9
9
  if [[ `rvm --version 2> /dev/null` == "" ]]; then
10
+ echo "rvm_prefix=/usr/local" > /etc/rvmrc
10
11
  wget -qNP /tmp http://rvm.beginrescueend.com/releases/rvm-install-head
11
12
  bash /tmp/rvm-install-head
12
13
  echo "#{rubber_env.rvm_prepare}" > /etc/profile.d/rvm.sh
13
- echo "rvm_prefix=/usr/local" > /etc/rvmrc
14
14
  fi
15
15
  ENDSCRIPT
16
16
  end
@@ -13,7 +13,7 @@ packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, z
13
13
 
14
14
  # REQUIRED: Set to the rvm version string for the ruby version you wish to use
15
15
  # Run "rvm list known" to see the list of possible options
16
- rvm_ruby: 1.9.2-head
16
+ rvm_ruby: 1.9.2
17
17
 
18
18
  # When rvm is installed as root, and you set the default, it symlinks ruby executables
19
19
  # into /usr/local
@@ -12,7 +12,7 @@ namespace :rubber do
12
12
  if [[ ! -d "#{rubber_env.cassandra_dir}" ]]; then
13
13
  wget -qNP /tmp #{rubber_env.cassandra_pkg_url}
14
14
  tar -C #{rubber_env.cassandra_prefix} -zxf /tmp/apache-cassandra-#{rubber_env.cassandra_version}-bin.tar.gz
15
- wget -nNO #{rubber_env.cassandra_dir}/jmxterm.jar http://downloads.sourceforge.net/project/cyclops-group/jmxterm/1.0-alpha-4/jmxterm-1.0-alpha-4-uber.jar
15
+ wget -qNO #{rubber_env.cassandra_dir}/jmxterm.jar http://downloads.sourceforge.net/project/cyclops-group/jmxterm/1.0-alpha-4/jmxterm-1.0-alpha-4-uber.jar
16
16
  fi
17
17
  ENDSCRIPT
18
18
  end
@@ -1,6 +1,6 @@
1
1
  passenger_version: 2.2.11
2
2
  passenger_root: "$GEM_HOME/gems/passenger-#{passenger_version}"
3
- passenger_ruby: "#{rvm_prefix}/bin/passenger_ruby"
3
+ passenger_ruby: "#{ruby_prefix}/bin/passenger_ruby"
4
4
  passenger_lib: "#{passenger_root}/ext/apache2/mod_passenger.so"
5
5
  passenger_listen_port: 7000
6
6
  passenger_listen_ssl_port: 7001
@@ -220,14 +220,14 @@ module Rubber
220
220
  capistrano.put(File.read(ec2_pk), ec2_pk_dest)
221
221
  capistrano.put(File.read(ec2_cert), ec2_cert_dest)
222
222
 
223
- arch = capistrano.capture "uname -m"
223
+ arch = capistrano.capture("uname -m").strip
224
224
  arch = case arch when /i\d86/ then "i386" else arch end
225
225
 
226
226
  capistrano.sudo_script "create_bundle", <<-CMD
227
227
  rvm use system
228
228
  export RUBYLIB=/usr/lib/site_ruby/
229
229
  unset RUBYOPT
230
- nohup ec2-bundle-vol --batch -d /mnt -k #{ec2_pk_dest} -c #{ec2_cert_dest} -u #{@aws_env.account} -p #{image_name} -r #{arch} &> /tmp/ec2-bundle-vol.log &
230
+ nohup ec2-bundle-vol --batch -d /mnt -k #{ec2_pk_dest} -c #{ec2_cert_dest} -u #{@aws_env.account} -p #{image_name} -r #{arch} &> /tmp/ec2-bundle-vol.log &
231
231
  echo "Creating image from instance volume..."
232
232
  while true; do
233
233
  if ! ps ax | grep -q "[e]c2-bundle-vol"; then exit; fi
@@ -14,7 +14,10 @@ module Rubber
14
14
 
15
15
  def initialize(config_root)
16
16
  @config_root = config_root
17
- @config_files = ["#{@config_root}/rubber.yml"] + Dir["#{@config_root}/rubber-*.yml"].sort
17
+ @config_files = ["#{@config_root}/rubber.yml"]
18
+ @config_files += Dir["#{@config_root}/rubber-*.yml"].sort
19
+ @config_files -= Dir["#{@config_root}/rubber-*-env.yml"]
20
+ @config_files << "#{@config_root}/rubber-#{Rubber.env}-env.yml"
18
21
  @items = {}
19
22
  @config_files.each { |file| read_config(file) }
20
23
  @config_secret = bind().rubber_secret
@@ -292,6 +292,10 @@ namespace :rubber do
292
292
  instance_item.external_ip = instance[:external_ip]
293
293
  instance_item.internal_host = instance[:internal_host]
294
294
  instance_item.zone = instance[:zone]
295
+ instance_item.platform = instance[:platform]
296
+
297
+ # turn back on root ssh access if we are using root as the capistrano user for connecting
298
+ enable_root_ssh(instance_item.external_ip, fetch(:initial_ssh_user, 'ubuntu')) if user == 'root'
295
299
 
296
300
  # setup amazon elastic ips if configured to do so
297
301
  setup_static_ips
@@ -306,8 +310,13 @@ namespace :rubber do
306
310
  # Connect to newly created instance and grab its internal ip
307
311
  # so that we can update all aliases
308
312
  task :_get_ip, :hosts => instance_item.external_ip do
309
- instance_item.internal_ip = capture(print_ip_command).strip
310
- rubber_instances.save()
313
+ # There's no good way to get the internal IP for a Windows host, so just set it to the external
314
+ # and let the router handle mapping to the internal network.
315
+ if instance_item.windows?
316
+ instance_item.internal_ip = instance_item.external_ip
317
+ else
318
+ instance_item.internal_ip = capture(print_ip_command).strip
319
+ end
311
320
  end
312
321
 
313
322
  # even though instance is running, sometimes ssh hasn't started yet,
@@ -253,7 +253,7 @@ namespace :rubber do
253
253
  DESC
254
254
  after "deploy:update_code", "rubber:install_bundler_gems" if Rubber::Util.is_bundler?
255
255
  task :install_bundler_gems do
256
- rsudo "cd #{current_release} && RAILS_ENV=#{RUBBER_ENV} bundle install"
256
+ rsudo "cd #{current_release} && RAILS_ENV=#{RUBBER_ENV} bundle install --without development test"
257
257
  end
258
258
 
259
259
  desc <<-DESC
@@ -3,7 +3,7 @@ gem 'test-unit'
3
3
 
4
4
  require 'test/unit'
5
5
  require 'tempfile'
6
- require 'test_helper'
6
+ require File.expand_path(File.join(__FILE__, '..', 'test_helper'))
7
7
 
8
8
  class EnvironmentTest < Test::Unit::TestCase
9
9
  include Rubber::Configuration
@@ -42,6 +42,14 @@ class EnvironmentTest < Test::Unit::TestCase
42
42
  assert_equal 'host1val2', e.var2, 'env not retrieving right val for method missing'
43
43
  end
44
44
 
45
+ def test_host_override
46
+ env = Rubber::Configuration::Environment.new("#{File.dirname(__FILE__)}/fixtures/basic")
47
+ e = env.bind('norole', 'host2')
48
+ assert_equal 'host2val3', e['var3'], 'env not retrieving right val'
49
+ assert_equal %w[host2val4a host2val4b], e['var4'], 'env not retrieving right val'
50
+ assert_equal [{'var51a' => 'val51a', 'var52a' => 'val52a'}, {'var53' => 'val53'}, {'var54' => 'val54'}], e['var5'], 'env not retrieving right val'
51
+ end
52
+
45
53
  def test_combine
46
54
  env = Rubber::Configuration::Environment
47
55
  assert_equal "new", env.combine("old", "new"), "Last should win for scalar combine"
@@ -3,7 +3,7 @@ gem 'test-unit'
3
3
 
4
4
  require 'test/unit'
5
5
  require 'tempfile'
6
- require 'test_helper'
6
+ require File.expand_path(File.join(__FILE__, '..', 'test_helper'))
7
7
 
8
8
  class GeneratorTest < Test::Unit::TestCase
9
9
  include Rubber::Configuration
@@ -186,7 +186,7 @@ class GeneratorTest < Test::Unit::TestCase
186
186
  hello
187
187
  SRC
188
188
 
189
- assert_raises RuntimeError do
189
+ assert_raises do
190
190
  Generator.new(nil, nil, nil).transform(src)
191
191
  end
192
192
 
@@ -232,7 +232,7 @@ class GeneratorTest < Test::Unit::TestCase
232
232
  FileUtils.rm_rf(out_dir)
233
233
  assert ! File.exists?(out_dir)
234
234
 
235
- g = Generator.new("#{File.dirname(__FILE__)}/fixtures/basic", ['role1'], ['host1'], :out_dir => out_dir)
235
+ g = Generator.new("#{File.dirname(__FILE__)}/fixtures/basic", ['role1'], 'host1', :out_dir => out_dir)
236
236
  g.run()
237
237
  assert File.directory?(out_dir), "scoped transform did not create dir"
238
238
  assert_equal ['bar.conf', 'foo.conf'], list_dir(out_dir), "scoped transform did not create correct files"
@@ -243,12 +243,12 @@ class GeneratorTest < Test::Unit::TestCase
243
243
  FileUtils.rm_rf(out_dir)
244
244
  end
245
245
 
246
- def test_ordering
246
+ def test_ordering_of_additive
247
247
  out_dir = "#{Dir::tmpdir}/test_rubber_ordering"
248
248
  FileUtils.rm_rf(out_dir)
249
249
  assert ! File.exists?(out_dir)
250
250
 
251
- g = Generator.new("#{File.dirname(__FILE__)}/fixtures/generator_order", ['role2', 'role1'], ['host1'], :out_dir => out_dir)
251
+ g = Generator.new("#{File.dirname(__FILE__)}/fixtures/generator_order", ['role2', 'role1'], 'host1', :out_dir => out_dir)
252
252
  g.run()
253
253
  assert File.directory?(out_dir), "transform did not create dir"
254
254
  assert_equal ['out.conf'], list_dir(out_dir), "transform did not create correct file"
@@ -3,7 +3,7 @@ gem 'test-unit'
3
3
 
4
4
  require 'test/unit'
5
5
  require 'tempfile'
6
- require 'test_helper'
6
+ require File.expand_path(File.join(__FILE__, '..', 'test_helper'))
7
7
 
8
8
  class InstanceTest < Test::Unit::TestCase
9
9
  include Rubber::Configuration
data/test/util_test.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  gem 'test-unit'
3
3
 
4
4
  require 'test/unit'
5
- require 'test_helper'
5
+ require File.expand_path(File.join(__FILE__, '..', 'test_helper'))
6
6
 
7
7
  class UtilTest < Test::Unit::TestCase
8
8
 
data/test/zerigo_test.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  gem 'test-unit'
3
3
 
4
4
  require 'test/unit'
5
- require 'test_helper'
5
+ require File.expand_path(File.join(__FILE__, '..', 'test_helper'))
6
6
  require 'rubber/dns'
7
7
  require 'rubber/dns/zerigo'
8
8
  require 'rexml/document'
@@ -73,6 +73,7 @@ class ZerigoTest < Test::Unit::TestCase
73
73
 
74
74
  def test_update_record
75
75
  params = {:host => 'host1', :domain => 'example1.com', :data => "1.1.1.1"}
76
+ new = {:host => 'host1', :domain => 'example1.com', :data => "1.1.1.2"}
76
77
 
77
78
  FakeWeb.register_uri(:get,
78
79
  "http://foo%40bar.com:testtoken@ns.zerigo.com/api/1.1/hosts.xml?fqdn=host1.example1.com&zone_id=1",
@@ -81,7 +82,7 @@ class ZerigoTest < Test::Unit::TestCase
81
82
  "http://foo%40bar.com:testtoken@ns.zerigo.com/api/1.1/hosts/1.xml",
82
83
  :body => "")
83
84
 
84
- @dns.update_host_record(params)
85
+ @dns.update_host_record(params, new)
85
86
  end
86
87
 
87
88
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubber
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 5
9
- - 3
10
- version: 1.5.3
8
+ - 4
9
+ version: 1.5.4
11
10
  platform: ruby
12
11
  authors:
13
12
  - Matt Conway
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-05-26 00:00:00 -04:00
17
+ date: 2010-06-06 00:00:00 -04:00
19
18
  default_executable: vulcanize
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 31
30
28
  segments:
31
29
  - 2
32
30
  - 4
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 59
46
43
  segments:
47
44
  - 0
48
45
  - 9
@@ -58,7 +55,6 @@ dependencies:
58
55
  requirements:
59
56
  - - ">="
60
57
  - !ruby/object:Gem::Version
61
- hash: 3
62
58
  segments:
63
59
  - 0
64
60
  version: "0"
@@ -72,7 +68,6 @@ dependencies:
72
68
  requirements:
73
69
  - - ">="
74
70
  - !ruby/object:Gem::Version
75
- hash: 3
76
71
  segments:
77
72
  - 0
78
73
  version: "0"
@@ -480,20 +475,14 @@ has_rdoc: true
480
475
  homepage: http://github.com/wr0ngway/rubber
481
476
  licenses: []
482
477
 
483
- post_install_message: |+
484
-
485
- ********************************************************************************
486
-
487
- Thank you for installing rubber. Please note that this is a major upgrade
488
- and we've moved towards using RVM for Ruby configuration on your EC2 instances.
489
-
490
- If you're upgrading rubber, please make sure to read the upgrade notes and
491
- make the necessary configuration changes:
492
-
493
- http://wiki.github.com/wr0ngway/rubber/upgrading
494
-
495
- ********************************************************************************
496
-
478
+ post_install_message: "\n\
479
+ ********************************************************************************\n\n\
480
+ Thank you for installing rubber. Please note that this is a major upgrade\n\
481
+ and we've moved towards using RVM for Ruby configuration on your EC2 instances.\n\n\
482
+ If you're upgrading rubber, please make sure to read the upgrade notes and\n\
483
+ make the necessary configuration changes:\n\n\
484
+ http://wiki.github.com/wr0ngway/rubber/upgrading\n\n\
485
+ ********************************************************************************\n\n"
497
486
  rdoc_options:
498
487
  - --charset=UTF-8
499
488
  require_paths:
@@ -503,7 +492,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
503
492
  requirements:
504
493
  - - ">="
505
494
  - !ruby/object:Gem::Version
506
- hash: 3
507
495
  segments:
508
496
  - 0
509
497
  version: "0"
@@ -512,7 +500,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
512
500
  requirements:
513
501
  - - ">="
514
502
  - !ruby/object:Gem::Version
515
- hash: 3
516
503
  segments:
517
504
  - 0
518
505
  version: "0"