elzar 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +46 -83
- data/README.md +19 -17
- data/USAGE.md +257 -0
- data/bin/elzar +94 -0
- data/chef/site-cookbooks/ruby/metadata.rb +3 -1
- data/chef/site-cookbooks/ruby/recipes/default.rb +1 -0
- data/chef/site-cookbooks/ruby/recipes/path.rb +17 -0
- data/elzar.gemspec +4 -0
- data/lib/elzar.rb +5 -1
- data/lib/elzar/assistant.rb +82 -70
- data/lib/elzar/aws_config.rb +46 -0
- data/lib/elzar/cli.rb +143 -0
- data/lib/elzar/compute.rb +52 -0
- data/lib/elzar/core_ext/hash.rb +18 -0
- data/lib/elzar/fog.rb +53 -0
- data/lib/elzar/ssh_key_locator.rb +37 -0
- data/lib/elzar/templates/Gemfile +4 -4
- data/lib/elzar/templates/Vagrantfile.erb +1 -1
- data/lib/elzar/templates/aws_config.private.yml +13 -0
- data/lib/elzar/templates/aws_config.yml +6 -0
- data/lib/elzar/templates/data_bags/deploy/authorized_keys.json +4 -5
- data/lib/elzar/templates/dna/rails.json +15 -0
- data/lib/elzar/templates/gitignore +1 -0
- data/lib/elzar/version.rb +1 -1
- data/script/ci_nightly +14 -0
- data/spec/fixtures/rails_integration_template/add_root_user.rb +9 -0
- data/spec/fixtures/rails_integration_template/database.yml +7 -0
- data/spec/fixtures/rails_integration_template/deploy.rb +11 -0
- data/spec/fixtures/rails_integration_template/template.rb +22 -0
- data/spec/integration/rails_spec.rb +190 -0
- data/spec/lib/elzar/assistant_spec.rb +30 -0
- data/spec/lib/elzar/aws_config_spec.rb +84 -0
- data/spec/lib/elzar/ssh_key_locator_spec.rb +51 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/shell_interaction_helpers.rb +33 -0
- metadata +107 -7
- data/lib/elzar/chef_dna.rb +0 -48
- data/lib/elzar/templates/dna.json +0 -25
- data/spec/chef_dna_spec.rb +0 -58
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"run_list":["role[plumbing]", "mysql::server", "role[enterprise_appstack]", "rails_app"],
|
3
|
-
"mysql": {"server_root_password": ""},
|
4
|
-
"passenger": {
|
5
|
-
"version": "3.0.11",
|
6
|
-
"root_path": "/opt/relevance-ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.11",
|
7
|
-
"module_path": "/opt/relevance-ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.11/ext/apache2/mod_passenger.so"
|
8
|
-
},
|
9
|
-
"passenger_enterprise": {
|
10
|
-
"version": "3.0.11",
|
11
|
-
"root_path": "/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.11",
|
12
|
-
"module_path": "/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so"
|
13
|
-
},
|
14
|
-
"ruby": {
|
15
|
-
"version": "1.9.3-p125",
|
16
|
-
"url": "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz"
|
17
|
-
},
|
18
|
-
"ruby_enterprise": {
|
19
|
-
"version": "1.8.7-2012.02",
|
20
|
-
"url": "http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2012.02"
|
21
|
-
},
|
22
|
-
"rails_app": {
|
23
|
-
"name": "elzar_test"
|
24
|
-
}
|
25
|
-
}
|
data/spec/chef_dna_spec.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Elzar::ChefDNA do
|
4
|
-
let(:database) { 'mysql' }
|
5
|
-
let(:json) {
|
6
|
-
{
|
7
|
-
"run_list" => ["role[plumbing]", "mysql::server", "role[enterprise_appstack]", "rails_app"],
|
8
|
-
'ruby' => {'url' => '', 'version' => '', 'gems_version' => ''},
|
9
|
-
'ruby_enterprise' => {'url' => '', 'version' => '', 'gems_version' => ''}
|
10
|
-
}
|
11
|
-
}
|
12
|
-
let(:run_list) { json['run_list'] }
|
13
|
-
|
14
|
-
def splice(database = nil)
|
15
|
-
Elzar::ChefDNA.gene_splice(json, database, ruby_version)
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '.gene_splice' do
|
19
|
-
context 'for mri ruby' do
|
20
|
-
let(:ruby_version) { 'ruby-1.9.3-p194' }
|
21
|
-
|
22
|
-
it "updates run_list correctly for mysql" do
|
23
|
-
splice 'mysql'
|
24
|
-
run_list[1].should == 'mysql::server'
|
25
|
-
end
|
26
|
-
|
27
|
-
it "updates run_list correctly for mysql as default" do
|
28
|
-
splice nil
|
29
|
-
run_list[1].should == 'mysql::server'
|
30
|
-
end
|
31
|
-
|
32
|
-
it "updates run_list correctly for postgresql" do
|
33
|
-
splice 'postgresql'
|
34
|
-
run_list[1].should == 'role[postgres_database]'
|
35
|
-
end
|
36
|
-
|
37
|
-
it "updates ruby dna correctly" do
|
38
|
-
splice
|
39
|
-
json['ruby']['url'].should == "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz"
|
40
|
-
json['ruby']['version'].should == '1.9.3-p194'
|
41
|
-
json['ruby']['gems_version'].should == Gem::VERSION
|
42
|
-
run_list[2].should == 'role[ruby_appstack]'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context 'for ree' do
|
47
|
-
let(:ruby_version) { 'ree-1.8.7-2011.03' }
|
48
|
-
|
49
|
-
it "updates ree dna correctly" do
|
50
|
-
splice
|
51
|
-
json['ruby_enterprise']['url'].should == "http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03"
|
52
|
-
json['ruby_enterprise']['version'].should == '1.8.7-2011.03'
|
53
|
-
json['ruby_enterprise']['gems_version'].should == Gem::VERSION
|
54
|
-
run_list[2].should == 'role[enterprise_appstack]'
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|