hugo 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -4,10 +4,10 @@ require 'rake'
4
4
  begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gemspec|
7
- gemspec.add_dependency('amazon-ec2')
8
- gemspec.add_dependency('net-ssh')
9
- gemspec.add_dependency('json')
10
-
7
+ gemspec.add_dependency('amazon-ec2', '= 0.7.5')
8
+ gemspec.add_dependency('json', '= 1.2.0')
9
+ gemspec.add_dependency('net-ssh', '= 2.0.16')
10
+
11
11
  gemspec.name = "hugo"
12
12
  gemspec.summary = "Deploy Your Rack Apps to Cloud"
13
13
  gemspec.description = "A easy to understand DSL that makes it dirt simple to deploy to the cloud."
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/lib/hugo/aws/ec2.rb CHANGED
@@ -65,13 +65,16 @@ module Hugo
65
65
 
66
66
  def ssh(commands, dna=nil, key_pair_file=nil)
67
67
  raise ArgumentError.new("Key Pair File is required") if key_pair_file.nil?
68
- Net::SSH.start(self.uri, "ubuntu", :keys => key_pair_file) do |ssh|
69
- if dna
70
- ssh.exec!("echo \"#{dna.to_json.gsub('"','\"')}\" > ~/dna.json")
71
- end
72
- commands.each do |cmd|
73
- puts ssh.exec!(cmd)
68
+ begin
69
+ Net::SSH.start(self.uri, "ubuntu", :keys => key_pair_file) do |ssh|
70
+ if dna
71
+ ssh.exec!("echo \"#{dna.to_json.gsub('"','\"')}\" > ~/dna.json")
72
+ end
73
+ commands.each do |cmd|
74
+ puts ssh.exec!(cmd)
75
+ end
74
76
  end
77
+ rescue
75
78
  end
76
79
  end
77
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hugo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Wilson
@@ -19,41 +19,34 @@ dependencies:
19
19
  version_requirement:
20
20
  version_requirements: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - ">="
22
+ - - "="
23
23
  - !ruby/object:Gem::Version
24
- version: "0"
24
+ version: 0.7.5
25
25
  version:
26
26
  - !ruby/object:Gem::Dependency
27
- name: net-ssh
27
+ name: json
28
28
  type: :runtime
29
29
  version_requirement:
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "="
33
33
  - !ruby/object:Gem::Version
34
- version: "0"
34
+ version: 1.2.0
35
35
  version:
36
36
  - !ruby/object:Gem::Dependency
37
- name: json
37
+ name: net-ssh
38
38
  type: :runtime
39
39
  version_requirement:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - "="
43
43
  - !ruby/object:Gem::Version
44
- version: "0"
44
+ version: 2.0.16
45
45
  version:
46
46
  description: A easy to understand DSL that makes it dirt simple to deploy to the cloud.
47
47
  email: tom@jackhq.com
48
- executables:
49
- - autospec
50
- - ec2-gem-example.rb
51
- - ec2-gem-profile.rb
52
- - ec2sh
53
- - edit_json.rb
54
- - prettify_json.rb
55
- - setup.rb
56
- - spec
48
+ executables: []
49
+
57
50
  extensions: []
58
51
 
59
52
  extra_rdoc_files: []
@@ -64,17 +57,9 @@ files:
64
57
  - Gemfile
65
58
  - Rakefile
66
59
  - VERSION
67
- - bin/autospec
68
- - bin/ec2-gem-example.rb
69
- - bin/ec2-gem-profile.rb
70
- - bin/ec2sh
71
- - bin/setup.rb
72
- - bin/spec
73
60
  - config/hugo.yml.example
74
61
  - example/myhugo.rb
75
- - hugo.gemspec
76
62
  - lib/.DS_Store
77
- - lib/hugo.old
78
63
  - lib/hugo.rb
79
64
  - lib/hugo/.DS_Store
80
65
  - lib/hugo/app.rb
@@ -85,7 +70,6 @@ files:
85
70
  - lib/hugo/cloud.rb
86
71
  - lib/hugo/database.rb
87
72
  - lib/hugo/mixin/params_validate.rb
88
- - pkg/hugo-0.1.0.gem
89
73
  - readme.md
90
74
  - spec/.DS_Store
91
75
  - spec/lib/hugo/app_spec.rb
@@ -97,11 +81,6 @@ files:
97
81
  - spec/lib/hugo_spec.rb
98
82
  - spec/spec.opts
99
83
  - spec/spec_helper.rb
100
- - vendor/gems/cache/amazon-ec2-0.7.9.gem
101
- - vendor/gems/cache/json-1.2.0.gem
102
- - vendor/gems/cache/net-ssh-2.0.17.gem
103
- - vendor/gems/cache/rspec-1.2.9.gem
104
- - vendor/gems/cache/xml-simple-1.0.12.gem
105
84
  has_rdoc: true
106
85
  homepage: http://github.com/twilson63/hugo
107
86
  licenses: []
data/hugo.gemspec DELETED
@@ -1,96 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{hugo}
8
- s.version = "0.1.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Tom Wilson", "Barrett Little"]
12
- s.date = %q{2010-01-27}
13
- s.description = %q{A easy to understand DSL that makes it dirt simple to deploy to the cloud.}
14
- s.email = %q{tom@jackhq.com}
15
- s.executables = ["autospec", "ec2-gem-example.rb", "ec2-gem-profile.rb", "ec2sh", "edit_json.rb", "prettify_json.rb", "setup.rb", "spec"]
16
- s.files = [
17
- ".DS_Store",
18
- ".gitignore",
19
- "Gemfile",
20
- "Rakefile",
21
- "VERSION",
22
- "bin/autospec",
23
- "bin/ec2-gem-example.rb",
24
- "bin/ec2-gem-profile.rb",
25
- "bin/ec2sh",
26
- "bin/setup.rb",
27
- "bin/spec",
28
- "config/hugo.yml.example",
29
- "example/myhugo.rb",
30
- "hugo.gemspec",
31
- "lib/.DS_Store",
32
- "lib/hugo.old",
33
- "lib/hugo.rb",
34
- "lib/hugo/.DS_Store",
35
- "lib/hugo/app.rb",
36
- "lib/hugo/aws/ec2.rb",
37
- "lib/hugo/aws/elb.rb",
38
- "lib/hugo/aws/rds.rb",
39
- "lib/hugo/balancer.rb",
40
- "lib/hugo/cloud.rb",
41
- "lib/hugo/database.rb",
42
- "lib/hugo/mixin/params_validate.rb",
43
- "pkg/hugo-0.1.0.gem",
44
- "readme.md",
45
- "spec/.DS_Store",
46
- "spec/lib/hugo/app_spec.rb",
47
- "spec/lib/hugo/aws/ec2_spec.rb",
48
- "spec/lib/hugo/aws/elb_spec.rb",
49
- "spec/lib/hugo/aws/rds_spec.rb",
50
- "spec/lib/hugo/balancer_spec.rb",
51
- "spec/lib/hugo/database_spec.rb",
52
- "spec/lib/hugo_spec.rb",
53
- "spec/spec.opts",
54
- "spec/spec_helper.rb",
55
- "vendor/gems/cache/amazon-ec2-0.7.9.gem",
56
- "vendor/gems/cache/json-1.2.0.gem",
57
- "vendor/gems/cache/net-ssh-2.0.17.gem",
58
- "vendor/gems/cache/rspec-1.2.9.gem",
59
- "vendor/gems/cache/xml-simple-1.0.12.gem"
60
- ]
61
- s.homepage = %q{http://github.com/twilson63/hugo}
62
- s.rdoc_options = ["--charset=UTF-8"]
63
- s.require_paths = ["lib"]
64
- s.rubygems_version = %q{1.3.5}
65
- s.summary = %q{Deploy Your Rack Apps to Cloud}
66
- s.test_files = [
67
- "spec/lib/hugo/app_spec.rb",
68
- "spec/lib/hugo/aws/ec2_spec.rb",
69
- "spec/lib/hugo/aws/elb_spec.rb",
70
- "spec/lib/hugo/aws/rds_spec.rb",
71
- "spec/lib/hugo/balancer_spec.rb",
72
- "spec/lib/hugo/database_spec.rb",
73
- "spec/lib/hugo_spec.rb",
74
- "spec/spec_helper.rb"
75
- ]
76
-
77
- if s.respond_to? :specification_version then
78
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
79
- s.specification_version = 3
80
-
81
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
82
- s.add_runtime_dependency(%q<amazon-ec2>, [">= 0"])
83
- s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
84
- s.add_runtime_dependency(%q<json>, [">= 0"])
85
- else
86
- s.add_dependency(%q<amazon-ec2>, [">= 0"])
87
- s.add_dependency(%q<net-ssh>, [">= 0"])
88
- s.add_dependency(%q<json>, [">= 0"])
89
- end
90
- else
91
- s.add_dependency(%q<amazon-ec2>, [">= 0"])
92
- s.add_dependency(%q<net-ssh>, [">= 0"])
93
- s.add_dependency(%q<json>, [">= 0"])
94
- end
95
- end
96
-
data/lib/hugo.old DELETED
@@ -1,123 +0,0 @@
1
- # This makes sure the bundled gems are in our $LOAD_PATH
2
- require File.expand_path(File.join(File.dirname(__FILE__) + "/..", 'vendor', 'gems', 'environment'))
3
-
4
- # This actually requires the bundled gems
5
- Bundler.require_env
6
-
7
- require 'AWS'
8
- require 'net/ssh'
9
- require File.dirname(__FILE__) + '/hugo/rds'
10
- require File.dirname(__FILE__) + '/hugo/elb'
11
- require File.dirname(__FILE__) + '/hugo/ec2'
12
-
13
- module Hugo
14
-
15
- class << self
16
- def build(infrastructure, application, instances = 1)
17
- app_config = YAML.load_file("config/#{application}.yml")
18
- @rds = Rds.new(:server => infrastructure, :db => application,
19
- :user => app_config['database']['master_username'],
20
- :pwd => app_config['database']['master_user_password']
21
- )
22
- @rds.save
23
- @elb = Elb.new(:name => infrastructure)
24
- @elb.save
25
-
26
- instances.times do
27
- @ec2 = Ec2.new()
28
- @ec2.save
29
- @elb.add(@ec2.name)
30
- end
31
-
32
- setup(infrastructure, application)
33
-
34
- deploy(infrastructure, application)
35
-
36
- end
37
-
38
- def drop(infrastructure)
39
- Rds.find(infrastructure).destroy
40
- @elb = Elb.find(infrastructure)
41
- @elb.instances.each do |i|
42
- Ec2.find(i).destroy
43
- end
44
- @elb.destroy
45
- end
46
-
47
- def setup(infrastructure, application)
48
- hugo_config = YAML.load_file("config/hugo.yml")
49
-
50
- commands = []
51
- commands << 'sudo apt-get update -y'
52
- commands << 'sudo apt-get install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential git-core xfsprogs -y'
53
- commands << 'wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz && tar zxf rubygems-1.3.5.tgz'
54
- commands << 'cd rubygems-1.3.5 && sudo ruby setup.rb && sudo ln -sfv /usr/bin/gem1.8 /usr/bin/gem'
55
- commands << 'sudo gem update --system'
56
- commands << 'sudo gem install gemcutter --no-ri --no-rdoc'
57
- commands << 'sudo gem tumble'
58
- commands << 'sudo gem install chef ohai --no-ri --no-rdoc'
59
- commands << 'sudo gem source -a http://gems.github.com'
60
- commands << 'sudo gem install chef-deploy --no-ri --no-rdoc'
61
- commands << 'sudo gem install git --no-ri --no-rdoc'
62
- commands << "git clone #{hugo_config['git']} ~/hugo-repos"
63
- # Setup base role
64
- dna = { :run_list => ["role[web-base]"],
65
- :package_list => hugo_config['package_list'],
66
- :gem_list => hugo_config['gem_list'],
67
- :git => hugo_config['git'],
68
- :github => hugo_config['github'],
69
- :access_key => Ec2::ACCESS_KEY,
70
- :secret_key => Ec2::SECRET_KEY,
71
- :apache => hugo_config['apache']
72
-
73
- }
74
-
75
- commands << 'sudo chef-solo -c /home/ubuntu/hugo-repos/config/solo.rb -j /home/ubuntu/dna.json'
76
-
77
- @elb = Elb.find(infrastructure)
78
- @elb.instances.each do |i|
79
- Ec2.find(i).ssh(commands, dna)
80
- end
81
-
82
- end
83
-
84
- def deploy(infrastructure, application)
85
- hugo_config = YAML.load_file("config/hugo.yml")
86
- app_config = YAML.load_file("config/#{application}.yml")
87
-
88
- commands = []
89
- #commands << "git clone #{@@hugo_config['git']} ~/hugo-repos"
90
- commands << "cd hugo-repos && git pull"
91
- commands << 'sudo chef-solo -c /home/ubuntu/hugo-repos/config/solo.rb -j /home/ubuntu/dna.json'
92
-
93
- dna = { :run_list => app_config['run_list'],
94
- :package_list => app_config['package_list'] || {},
95
- :gem_list => app_config['gem_list'] || {},
96
- :application => application,
97
- :customer => infrastructure,
98
- :database => {
99
- :uri => Rds.find(infrastructure).uri,
100
- :user => app_config['database']['master_username'],
101
- :password => app_config['database']['master_user_password'] },
102
- :web => { :port => "8080", :ssl => "8443" },
103
- :git => hugo_config['git'],
104
- :github => hugo_config['github'],
105
- :access_key => Ec2::ACCESS_KEY,
106
- :secret_key => Ec2::SECRET_KEY,
107
- :app => app_config['app'] || nil
108
- }
109
-
110
- @elb = Elb.find(infrastructure)
111
- @elb.instances.each do |i|
112
- Ec2.find(i).ssh(commands, dna)
113
- end
114
- end
115
-
116
- def add(infrastructure, application)
117
- @elb = Elb.find(infrastructure)
118
-
119
- end
120
-
121
- end
122
-
123
- end
data/pkg/hugo-0.1.0.gem DELETED
Binary file
Binary file
Binary file
Binary file
Binary file