auser-poolparty 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. data/Manifest.txt +201 -0
  2. data/PostInstall.txt +17 -0
  3. data/Rakefile +22 -1
  4. data/bin/cloud-add-keypair +0 -0
  5. data/bin/cloud-osxcopy +22 -0
  6. data/bin/cloud-provision +1 -0
  7. data/bin/cloud-start +17 -15
  8. data/bin/cloud-terminate +23 -0
  9. data/bin/pool-start +14 -14
  10. data/bin/pool-start-monitor +1 -0
  11. data/config/hoe.rb +114 -0
  12. data/config/requirements.rb +15 -0
  13. data/lib/poolparty.rb +1 -0
  14. data/lib/poolparty/base_packages/haproxy.rb +32 -31
  15. data/lib/poolparty/base_packages/heartbeat.rb +2 -2
  16. data/lib/poolparty/base_packages/poolparty.rb +9 -3
  17. data/lib/poolparty/base_packages/ruby.rb +10 -0
  18. data/lib/poolparty/core/proc.rb +5 -0
  19. data/lib/poolparty/core/string.rb +1 -1
  20. data/lib/poolparty/helpers/binary.rb +6 -5
  21. data/lib/poolparty/helpers/display.rb +11 -2
  22. data/lib/poolparty/helpers/optioner.rb +6 -3
  23. data/lib/poolparty/helpers/provisioner_base.rb +9 -7
  24. data/lib/poolparty/helpers/provisioners/master.rb +38 -4
  25. data/lib/poolparty/helpers/provisioners/slave.rb +2 -2
  26. data/lib/poolparty/modules/cloud_resourcer.rb +20 -3
  27. data/lib/poolparty/modules/definable_resource.rb +1 -1
  28. data/lib/poolparty/modules/method_missing_sugar.rb +12 -4
  29. data/lib/poolparty/modules/pretty_printer.rb +2 -1
  30. data/lib/poolparty/net/remote.rb +1 -1
  31. data/lib/poolparty/net/remote_bases/ec2.rb +13 -10
  32. data/lib/poolparty/net/remote_instance.rb +3 -2
  33. data/lib/poolparty/net/remoter.rb +33 -18
  34. data/lib/poolparty/net/remoter_base.rb +3 -3
  35. data/lib/poolparty/plugins/gem_package.rb +6 -29
  36. data/lib/poolparty/plugins/git.rb +22 -0
  37. data/lib/poolparty/pool/base.rb +7 -6
  38. data/lib/poolparty/pool/cloud.rb +34 -5
  39. data/lib/poolparty/pool/custom_resource.rb +4 -4
  40. data/lib/poolparty/pool/plugin.rb +13 -14
  41. data/lib/poolparty/pool/resource.rb +19 -10
  42. data/lib/poolparty/pool/resources/class_package.rb +10 -6
  43. data/lib/poolparty/pool/resources/conditional.rb +41 -0
  44. data/lib/poolparty/pool/resources/gem.rb +2 -2
  45. data/lib/poolparty/pool/script.rb +25 -2
  46. data/lib/poolparty/templates/haproxy.conf +1 -1
  47. data/lib/poolparty/templates/puppet.conf +4 -2
  48. data/lib/poolparty/version.rb +1 -1
  49. data/poolparty.gemspec +60 -0
  50. data/setup.rb +1585 -0
  51. data/spec/poolparty/base_packages/haproxy_spec.rb +13 -0
  52. data/spec/poolparty/base_packages/heartbeat_spec.rb +30 -0
  53. data/spec/poolparty/bin/console_spec.rb +80 -0
  54. data/spec/poolparty/core/array_spec.rb +26 -0
  55. data/spec/poolparty/core/float.rb +13 -0
  56. data/spec/poolparty/core/hash_spec.rb +63 -0
  57. data/spec/poolparty/core/kernel_spec.rb +24 -0
  58. data/spec/poolparty/core/module_spec.rb +15 -0
  59. data/spec/poolparty/core/object_spec.rb +40 -0
  60. data/spec/poolparty/core/string_spec.rb +152 -0
  61. data/spec/poolparty/core/time_spec.rb +52 -0
  62. data/spec/poolparty/helpers/binary_spec.rb +26 -0
  63. data/spec/poolparty/helpers/display_spec.rb +13 -0
  64. data/spec/poolparty/helpers/optioner_spec.rb +39 -0
  65. data/spec/poolparty/helpers/provisioner_base_spec.rb +121 -0
  66. data/spec/poolparty/helpers/provisioners/master_spec.rb +54 -0
  67. data/spec/poolparty/helpers/provisioners/slave_spec.rb +28 -0
  68. data/spec/poolparty/modules/cloud_resourcer_spec.rb +135 -0
  69. data/spec/poolparty/modules/configurable_spec.rb +26 -0
  70. data/spec/poolparty/modules/definable_resource.rb +9 -0
  71. data/spec/poolparty/modules/file_writer_spec.rb +49 -0
  72. data/spec/poolparty/modules/s3_string_spec.rb +15 -0
  73. data/spec/poolparty/net/remote_bases/ec2_spec.rb +92 -0
  74. data/spec/poolparty/net/remote_instance_spec.rb +70 -0
  75. data/spec/poolparty/net/remote_spec.rb +286 -0
  76. data/spec/poolparty/net/remoter_base_spec.rb +80 -0
  77. data/spec/poolparty/net/remoter_spec.rb +191 -0
  78. data/spec/poolparty/plugins/git_spec.rb +19 -0
  79. data/spec/poolparty/plugins/line_spec.rb +16 -0
  80. data/spec/poolparty/plugins/svn_spec.rb +16 -0
  81. data/spec/poolparty/pool/base_spec.rb +108 -0
  82. data/spec/poolparty/pool/cloud_spec.rb +299 -0
  83. data/spec/poolparty/pool/configurers/files/ruby_basic.rb +17 -0
  84. data/spec/poolparty/pool/configurers/files/ruby_plugins.rb +16 -0
  85. data/spec/poolparty/pool/configurers/ruby_spec.rb +58 -0
  86. data/spec/poolparty/pool/custom_resource_spec.rb +115 -0
  87. data/spec/poolparty/pool/example_spec.rb +112 -0
  88. data/spec/poolparty/pool/plugin_model_spec.rb +63 -0
  89. data/spec/poolparty/pool/plugin_spec.rb +85 -0
  90. data/spec/poolparty/pool/pool_spec.rb +83 -0
  91. data/spec/poolparty/pool/resource_spec.rb +224 -0
  92. data/spec/poolparty/pool/resources/class_package_spec.rb +84 -0
  93. data/spec/poolparty/pool/resources/conditional_spec.rb +38 -0
  94. data/spec/poolparty/pool/resources/cron_spec.rb +49 -0
  95. data/spec/poolparty/pool/resources/directory_spec.rb +40 -0
  96. data/spec/poolparty/pool/resources/exec_spec.rb +37 -0
  97. data/spec/poolparty/pool/resources/file_spec.rb +40 -0
  98. data/spec/poolparty/pool/resources/gem_spec.rb +16 -0
  99. data/spec/poolparty/pool/resources/host_spec.rb +28 -0
  100. data/spec/poolparty/pool/resources/package_spec.rb +44 -0
  101. data/spec/poolparty/pool/resources/remote_file_spec.rb +40 -0
  102. data/spec/poolparty/pool/resources/service_spec.rb +45 -0
  103. data/spec/poolparty/pool/resources/sshkey_spec.rb +48 -0
  104. data/spec/poolparty/pool/resources/variable_spec.rb +20 -0
  105. data/spec/poolparty/pool/script_spec.rb +51 -0
  106. data/spec/poolparty/pool/test_plugins/sshkey_test +2 -0
  107. data/spec/poolparty/pool/test_plugins/virtual_host_template.erb +0 -0
  108. data/spec/poolparty/pool/test_plugins/webserver.rb +46 -0
  109. data/spec/poolparty/poolparty_spec.rb +33 -0
  110. data/spec/poolparty/spec_helper.rb +120 -0
  111. data/test/test_generator_helper.rb +29 -0
  112. data/test/test_helper.rb +2 -0
  113. data/test/test_pool_spec_generator.rb +47 -0
  114. data/test/test_poolparty.rb +11 -0
  115. data/website/index.html +81 -0
  116. data/website/index.txt +72 -0
  117. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  118. data/website/stylesheets/screen.css +138 -0
  119. data/website/template.html.erb +48 -0
  120. metadata +178 -60
data/Manifest.txt ADDED
@@ -0,0 +1,201 @@
1
+ History.txt
2
+ License.txt
3
+ Manifest.txt
4
+ PostInstall.txt
5
+ README.txt
6
+ Rakefile
7
+ bin/cloud
8
+ bin/cloud-add-keypair
9
+ bin/cloud-configure
10
+ bin/cloud-contract
11
+ bin/cloud-expand
12
+ bin/cloud-list
13
+ bin/cloud-maintain
14
+ bin/cloud-osxcopy
15
+ bin/cloud-provision
16
+ bin/cloud-reconfigure
17
+ bin/cloud-ssh
18
+ bin/cloud-start
19
+ bin/cloud-terminate
20
+ bin/pool
21
+ bin/pool-console
22
+ bin/pool-describe
23
+ bin/pool-list
24
+ bin/pool-provision
25
+ bin/pool-spec
26
+ bin/pool-start
27
+ bin/pool-start-monitor
28
+ config/hoe.rb
29
+ config/requirements.rb
30
+ examples/basic.rb
31
+ examples/plugin_without_plugin_directory.rb
32
+ examples/poolparty.rb
33
+ examples/with_apache_plugin.rb
34
+ generators/poolspec/USAGE
35
+ generators/poolspec/poolspec_generator.rb
36
+ generators/poolspec/templates/pool_spec_template.erb
37
+ lib/erlang/eb_server.erl
38
+ lib/poolparty.rb
39
+ lib/poolparty/base_packages/haproxy.rb
40
+ lib/poolparty/base_packages/heartbeat.rb
41
+ lib/poolparty/base_packages/poolparty.rb
42
+ lib/poolparty/base_packages/ruby.rb
43
+ lib/poolparty/core/array.rb
44
+ lib/poolparty/core/exception.rb
45
+ lib/poolparty/core/float.rb
46
+ lib/poolparty/core/hash.rb
47
+ lib/poolparty/core/kernel.rb
48
+ lib/poolparty/core/module.rb
49
+ lib/poolparty/core/my_open_struct.rb
50
+ lib/poolparty/core/object.rb
51
+ lib/poolparty/core/proc.rb
52
+ lib/poolparty/core/string.rb
53
+ lib/poolparty/core/symbol.rb
54
+ lib/poolparty/core/time.rb
55
+ lib/poolparty/exceptions/RemoteException.rb
56
+ lib/poolparty/exceptions/ResourceException.rb
57
+ lib/poolparty/exceptions/RuntimeException.rb
58
+ lib/poolparty/exceptions/SpecException.rb
59
+ lib/poolparty/exceptions/TemplateNotFound.rb
60
+ lib/poolparty/helpers/binary.rb
61
+ lib/poolparty/helpers/console.rb
62
+ lib/poolparty/helpers/display.rb
63
+ lib/poolparty/helpers/optioner.rb
64
+ lib/poolparty/helpers/provisioner_base.rb
65
+ lib/poolparty/helpers/provisioners/master.rb
66
+ lib/poolparty/helpers/provisioners/slave.rb
67
+ lib/poolparty/modules/cloud_resourcer.rb
68
+ lib/poolparty/modules/configurable.rb
69
+ lib/poolparty/modules/definable_resource.rb
70
+ lib/poolparty/modules/file_writer.rb
71
+ lib/poolparty/modules/method_missing_sugar.rb
72
+ lib/poolparty/modules/output.rb
73
+ lib/poolparty/modules/pretty_printer.rb
74
+ lib/poolparty/modules/s3_string.rb
75
+ lib/poolparty/modules/safe_instance.rb
76
+ lib/poolparty/monitors/base_monitor.rb
77
+ lib/poolparty/net/remote.rb
78
+ lib/poolparty/net/remote_bases/ec2.rb
79
+ lib/poolparty/net/remote_instance.rb
80
+ lib/poolparty/net/remoter.rb
81
+ lib/poolparty/net/remoter_base.rb
82
+ lib/poolparty/plugins/gem_package.rb
83
+ lib/poolparty/plugins/git.rb
84
+ lib/poolparty/plugins/line.rb
85
+ lib/poolparty/plugins/svn.rb
86
+ lib/poolparty/pool/base.rb
87
+ lib/poolparty/pool/cloud.rb
88
+ lib/poolparty/pool/custom_resource.rb
89
+ lib/poolparty/pool/loggable.rb
90
+ lib/poolparty/pool/plugin.rb
91
+ lib/poolparty/pool/plugin_model.rb
92
+ lib/poolparty/pool/pool.rb
93
+ lib/poolparty/pool/resource.rb
94
+ lib/poolparty/pool/resources/class_package.rb
95
+ lib/poolparty/pool/resources/conditional.rb
96
+ lib/poolparty/pool/resources/cron.rb
97
+ lib/poolparty/pool/resources/directory.rb
98
+ lib/poolparty/pool/resources/exec.rb
99
+ lib/poolparty/pool/resources/file.rb
100
+ lib/poolparty/pool/resources/gem.rb
101
+ lib/poolparty/pool/resources/host.rb
102
+ lib/poolparty/pool/resources/package.rb
103
+ lib/poolparty/pool/resources/remote_file.rb
104
+ lib/poolparty/pool/resources/service.rb
105
+ lib/poolparty/pool/resources/sshkey.rb
106
+ lib/poolparty/pool/resources/variable.rb
107
+ lib/poolparty/pool/script.rb
108
+ lib/poolparty/templates/authkeys
109
+ lib/poolparty/templates/cib.xml
110
+ lib/poolparty/templates/fileserver.conf
111
+ lib/poolparty/templates/ha.cf
112
+ lib/poolparty/templates/haproxy.conf
113
+ lib/poolparty/templates/namespaceauth.conf
114
+ lib/poolparty/templates/puppet.conf
115
+ lib/poolparty/version.rb
116
+ lib/poolpartycl.rb
117
+ poolparty.gemspec
118
+ script/destroy
119
+ script/generate
120
+ script/txt2html
121
+ setup.rb
122
+ spec/poolparty/base_packages/haproxy_spec.rb
123
+ spec/poolparty/base_packages/heartbeat_spec.rb
124
+ spec/poolparty/bin/console_spec.rb
125
+ spec/poolparty/core/array_spec.rb
126
+ spec/poolparty/core/float.rb
127
+ spec/poolparty/core/hash_spec.rb
128
+ spec/poolparty/core/kernel_spec.rb
129
+ spec/poolparty/core/module_spec.rb
130
+ spec/poolparty/core/object_spec.rb
131
+ spec/poolparty/core/string_spec.rb
132
+ spec/poolparty/core/time_spec.rb
133
+ spec/poolparty/helpers/binary_spec.rb
134
+ spec/poolparty/helpers/display_spec.rb
135
+ spec/poolparty/helpers/optioner_spec.rb
136
+ spec/poolparty/helpers/provisioner_base_spec.rb
137
+ spec/poolparty/helpers/provisioners/master_spec.rb
138
+ spec/poolparty/helpers/provisioners/slave_spec.rb
139
+ spec/poolparty/modules/cloud_resourcer_spec.rb
140
+ spec/poolparty/modules/configurable_spec.rb
141
+ spec/poolparty/modules/definable_resource.rb
142
+ spec/poolparty/modules/file_writer_spec.rb
143
+ spec/poolparty/modules/s3_string_spec.rb
144
+ spec/poolparty/modules/tmp/willy/nilly.rb
145
+ spec/poolparty/net/remote_bases/ec2_spec.rb
146
+ spec/poolparty/net/remote_instance_spec.rb
147
+ spec/poolparty/net/remote_spec.rb
148
+ spec/poolparty/net/remoter_base_spec.rb
149
+ spec/poolparty/net/remoter_spec.rb
150
+ spec/poolparty/plugins/git_spec.rb
151
+ spec/poolparty/plugins/line_spec.rb
152
+ spec/poolparty/plugins/svn_spec.rb
153
+ spec/poolparty/pool/base_spec.rb
154
+ spec/poolparty/pool/cloud_spec.rb
155
+ spec/poolparty/pool/configurers/files/ruby_basic.rb
156
+ spec/poolparty/pool/configurers/files/ruby_plugins.rb
157
+ spec/poolparty/pool/configurers/ruby_spec.rb
158
+ spec/poolparty/pool/custom_resource_spec.rb
159
+ spec/poolparty/pool/example_spec.rb
160
+ spec/poolparty/pool/plugin_model_spec.rb
161
+ spec/poolparty/pool/plugin_spec.rb
162
+ spec/poolparty/pool/pool_spec.rb
163
+ spec/poolparty/pool/resource_spec.rb
164
+ spec/poolparty/pool/resources/class_package_spec.rb
165
+ spec/poolparty/pool/resources/conditional_spec.rb
166
+ spec/poolparty/pool/resources/cron_spec.rb
167
+ spec/poolparty/pool/resources/directory_spec.rb
168
+ spec/poolparty/pool/resources/exec_spec.rb
169
+ spec/poolparty/pool/resources/file_spec.rb
170
+ spec/poolparty/pool/resources/gem_spec.rb
171
+ spec/poolparty/pool/resources/host_spec.rb
172
+ spec/poolparty/pool/resources/package_spec.rb
173
+ spec/poolparty/pool/resources/remote_file_spec.rb
174
+ spec/poolparty/pool/resources/service_spec.rb
175
+ spec/poolparty/pool/resources/sshkey_spec.rb
176
+ spec/poolparty/pool/resources/variable_spec.rb
177
+ spec/poolparty/pool/script_spec.rb
178
+ spec/poolparty/pool/test_plugins/sshkey_test
179
+ spec/poolparty/pool/test_plugins/virtual_host_template.erb
180
+ spec/poolparty/pool/test_plugins/webserver.rb
181
+ spec/poolparty/poolparty_spec.rb
182
+ spec/poolparty/spec_helper.rb
183
+ tasks/cloud.rake
184
+ tasks/deployment.rake
185
+ tasks/development.rake
186
+ tasks/ec2.rake
187
+ tasks/environment.rake
188
+ tasks/instance.rake
189
+ tasks/server.rake
190
+ tasks/spec.rake
191
+ tasks/website.rake
192
+ test/test_generator_helper.rb
193
+ test/test_helper.rb
194
+ test/test_pool_spec_generator.rb
195
+ test/test_poolparty.rb
196
+ test_manifest.pp
197
+ website/index.html
198
+ website/index.txt
199
+ website/javascripts/rounded_corners_lite.inc.js
200
+ website/stylesheets/screen.css
201
+ website/template.html.erb
data/PostInstall.txt ADDED
@@ -0,0 +1,17 @@
1
+ Get ready to jump in the pool, you just installed PoolParty!
2
+
3
+ To get started, run the generator:
4
+
5
+ pool spec <name>
6
+
7
+ Please check out the documentation for any questions or check out the google groups at
8
+ http://groups.google.com/group/PoolPartyrb
9
+
10
+ Don't forget to check out the plugin tutorial @ http://PoolPartyrb.com for extending PoolParty!
11
+
12
+ For more information, check http://PoolPartyrb.com
13
+ On IRC:
14
+ irc.freenode.net
15
+ #PoolPartyrb
16
+
17
+ *** Ari Lerner @ <arilerner@mac.com> ***
data/Rakefile CHANGED
@@ -1,4 +1,25 @@
1
1
  require 'config/requirements'
2
2
  require 'config/hoe' # setup Hoe + all gem configuration
3
3
 
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }
4
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
5
+
6
+ desc "Clean tmp directory"
7
+ task :clean_tmp do |t|
8
+ %w(logs tmp ~).each do |dir|
9
+ FileUtils.rm_rf("#{File.dirname(__FILE__)}/#{dir}") if ::File.exists?("#{File.dirname(__FILE__)}/#{dir}")
10
+ end
11
+ end
12
+ desc "Remove the pkg directory"
13
+ task :clean_pkg do |t|
14
+ %w(pkg).each do |dir|
15
+ FileUtils.rm_rf("#{File.dirname(__FILE__)}/#{dir}") if ::File.exists?("#{File.dirname(__FILE__)}/#{dir}")
16
+ end
17
+ end
18
+ desc "Generate gemspec"
19
+ task :gemspec => [:spec, :clean_tmp, :"manifest:refresh", :local_deploy, :clean_pkg] do |t|
20
+ res = %x[rake debug_gem]
21
+ res = res.split("\n")[1..-1].join("\n")
22
+ ::File.open("#{GEM_NAME.downcase}.gemspec", "w+") do |f|
23
+ f << res
24
+ end
25
+ end
File without changes
data/bin/cloud-osxcopy ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
+ require "poolparty"
4
+ require "poolpartycl"
5
+ o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
6
+ opts.on('-n name', '--name name', 'Listing for cloud name') { |c| optioner.cloudname c }
7
+ end
8
+ load_pool(o.spec || Binary.get_existing_spec_location)
9
+
10
+ @location = o.location ? o.location : "remote"
11
+
12
+ include Remote
13
+
14
+ @clouds = o.cloudname ? [cloud(o.cloudname.downcase.to_sym)] : clouds
15
+
16
+ @clouds.each do |name, cloud|
17
+
18
+ with_cloud(cloud, {:location => @location}) do
19
+ Kernel.system "echo #{master.ip.chomp} | pbcopy"
20
+ end
21
+
22
+ end
data/bin/cloud-provision CHANGED
@@ -6,6 +6,7 @@ o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
6
6
  opts.on('-c [master|slaves|all]', '--class [master|slaves|all]', 'Provision class (default: all)') { |c| optioner.provision_class c }
7
7
  opts.on('-n name', '--name name', 'Listing for cloud name') { |c| optioner.cloudname c }
8
8
  end
9
+
9
10
  load_pool(o.spec || Binary.get_existing_spec_location)
10
11
 
11
12
  @provision_class = o.provision_class || "all"
data/bin/cloud-start CHANGED
@@ -10,20 +10,22 @@ load_pool(o.spec || Binary.get_existing_spec_location)
10
10
 
11
11
  @testing = o.testing
12
12
 
13
- include Remote
13
+ @clouds = o.cloudname ? {:cloud => cloud(o.cloudname.downcase.to_sym)} : clouds
14
14
 
15
- if o.cloudname
16
- @cloud = cloud(o.cloudname.downcase.to_sym)
17
- else
18
- puts "Cloud name or pool name required. Please specify it with -c name"
19
- exit(0)
20
- end
21
-
22
- with_cloud(@cloud, {:testing => @testing}) do
23
- puts header("Starting cloud")
24
- puts "#{list_of_running_instances.size} running instances (#{minimum_instances} - #{maximum_instances})"
25
- if (minimum_instances - list_of_running_instances.size) > 0
26
- puts "Starting #{minimum_instances - list_of_running_instances.size} instances"
27
- testing ? puts("\tNot launching while in testing mode") : launch_minimum_number_of_instances
28
- end
15
+ @clouds.each do |name, cloud|
16
+
17
+ with_cloud(cloud, {:testing => @testing}) do
18
+ puts header("Starting cloud")
19
+ puts "#{list_of_running_instances.size} running instances (#{minimum_instances} - #{maximum_instances})"
20
+ if (minimum_instances - list_of_running_instances.size) > 0
21
+ puts "Starting the master instance"
22
+ if testing
23
+ puts("\tNot launching while in testing mode")
24
+ else
25
+ launch_and_configure_master!
26
+ end
27
+ end
28
+ clear_base_directory unless testing
29
+ end
30
+
29
31
  end
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
+ require "poolparty"
4
+ require "poolpartycl"
5
+ o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
6
+ opts.on('-c [master|slaves|all]', '--class [master|slaves|all]', 'Provision class (default: all)') { |c| optioner.provision_class c }
7
+ opts.on('-n name', '--name name', 'Listing for cloud name') { |c| optioner.cloudname c }
8
+ end
9
+ load_pool(o.spec || Binary.get_existing_spec_location)
10
+
11
+ @clouds = o.cloudname ? {:cloud => cloud(o.cloudname.downcase.to_sym)} : clouds
12
+
13
+ @clouds.each do |name, cloud|
14
+
15
+ with_cloud(cloud, {:testing => o.testing, :location => @location, :provision_class => @provision_class}) do
16
+
17
+ list_of_running_instances.each do |inst|
18
+ puts "Shutting down #{inst.instance_id}"
19
+ terminate_instance!(inst.instance_id)
20
+ end
21
+
22
+ end
23
+ end
data/bin/pool-start CHANGED
@@ -12,21 +12,21 @@ load_pool(o.spec || Binary.get_existing_spec_location)
12
12
 
13
13
  include Remote
14
14
 
15
- if o.poolname
16
- @pool = pool(o.poolname.downcase.to_sym)
17
- else
18
- puts "Pool name required. Please specify it with -c name"
19
- exit(0)
20
- end
15
+ @pools = o.poolname ? [pool(o.poolname.downcase.to_sym)] : pools
21
16
 
22
- with_pool(@pool, {:testing => @testing}) do
23
- puts header("Starting pool")
24
- clouds.each do |name, cloud|
25
- puts subheader("Cloud: #{name}")
26
- puts "#{cloud.list_of_running_instances.size} running instances (#{cloud.minimum_instances} - #{cloud.maximum_instances})"
27
- if (cloud.minimum_instances - cloud.list_of_running_instances.size) > 0
28
- puts "Starting #{cloud.minimum_instances - cloud.list_of_running_instances.size} instances (from #{cloud.keypair})"
29
- testing ? puts("\tNot launching while in testing mode") : cloud.launch_minimum_number_of_instances
17
+ @pools.each do |name, pl|
18
+
19
+ with_pool(pl, {:testing => @testing}) do
20
+
21
+ puts header("Starting pool")
22
+ clouds.each do |name, cloud|
23
+ puts subheader("Cloud: #{name}")
24
+ puts "#{cloud.list_of_running_instances.size} running instances (#{cloud.minimum_instances} - #{cloud.maximum_instances})"
25
+ if (cloud.minimum_instances - cloud.list_of_running_instances.size) > 0
26
+ puts "Starting #{cloud.minimum_instances - cloud.list_of_running_instances.size} instances (from #{cloud.keypair})"
27
+ testing ? puts("\tNot launching while in testing mode") : cloud.launch_minimum_number_of_instances
28
+ end
30
29
  end
31
30
  end
31
+
32
32
  end
@@ -0,0 +1 @@
1
+ #!/usr/bin/env ruby
data/config/hoe.rb ADDED
@@ -0,0 +1,114 @@
1
+ require 'PoolParty/version'
2
+
3
+ AUTHOR = 'Ari Lerner' # can also be an array of Authors
4
+ EMAIL = "ari.lerner@citrusbyte.com"
5
+ DESCRIPTION =<<-EOM
6
+ Self-healing, auto-scaling cloud computing tool
7
+ EOM
8
+ GEM_NAME = 'poolparty' # what ppl will type to install your gem
9
+ RUBYFORGE_PROJECT = 'poolparty' # The unix name for your project
10
+ HOMEPAGE = "http://poolpartyrb.com"
11
+ HOMEPATH = "http://#{GEM_NAME}.rubyforge.org"
12
+ DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
13
+ EXTRA_DEPENDENCIES = [
14
+ ['activesupport'],
15
+ ['open4'],
16
+ ['logging']
17
+ ] # An array of rubygem dependencies [name, version]
18
+
19
+ @config_file = "~/.rubyforge/user-config.yml"
20
+ @config = nil
21
+ RUBYFORGE_USERNAME = "unknown"
22
+ def rubyforge_username
23
+ unless @config
24
+ begin
25
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
26
+ rescue
27
+ puts <<-EOS
28
+ ERROR: No rubyforge config file found: #{@config_file}
29
+ Run 'rubyforge setup' to prepare your env for access to Rubyforge
30
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
31
+ EOS
32
+ exit
33
+ end
34
+ end
35
+ RUBYFORGE_USERNAME.replace @config["username"]
36
+ end
37
+
38
+
39
+ REV = nil
40
+ # UNCOMMENT IF REQUIRED:
41
+ # REV = YAML.load(`svn info`)['Revision']
42
+ VERS = PoolParty::VERSION::STRING + (REV ? ".#{REV}" : "")
43
+ RDOC_OPTS = ['--quiet', '--title', 'PoolParty documentation',
44
+ "--opname", "index.html",
45
+ "--line-numbers",
46
+ "--main", "README",
47
+ "--inline-source"]
48
+
49
+ class Hoe
50
+ def extra_deps
51
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
52
+ @extra_deps
53
+ end
54
+ end
55
+
56
+ # Generate all the Rake tasks
57
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
58
+ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
59
+ p.developer(AUTHOR, EMAIL)
60
+ p.description = DESCRIPTION
61
+ p.summary = DESCRIPTION
62
+ p.url = HOMEPATH
63
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
64
+ p.test_globs = ["test/**/test_*.rb"]
65
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
66
+
67
+ # == Optional
68
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
69
+ p.extra_deps = EXTRA_DEPENDENCIES
70
+
71
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
72
+ end
73
+
74
+ CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
75
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
76
+ $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
77
+ $hoe.rsync_args = '-av --delete --ignore-errors'
78
+ $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
79
+
80
+ # # Gemspec creator
81
+ # spec = Gem::Specification.new do |s|
82
+ # s.name = GEM_NAME
83
+ # s.version = VERS
84
+ # s.platform = Gem::Platform::RUBY
85
+ # s.has_rdoc = true
86
+ # s.extra_rdoc_files = ["README.txt", "License.txt", 'History.txt']
87
+ # s.summary = DESCRIPTION
88
+ # s.description = s.summary
89
+ # s.author = AUTHOR
90
+ # s.email = EMAIL
91
+ # s.homepage = HOMEPATH
92
+ #
93
+ # # Uncomment this to add a dependency
94
+ # EXTRA_DEPENDENCIES.each do |arr|
95
+ # s.add_runtime_dependency arr
96
+ # end
97
+ # # s.extra_deps = EXTRA_DEPENDENCIES
98
+ #
99
+ # s.require_path = 'lib'
100
+ # s.autorequire = GEM_NAME
101
+ # s.files = %w(Rakefile History.txt README.txt) + Dir.glob("{examples,lib,specs,tasks,script,generators,bin}/**/*")
102
+ # end
103
+ #
104
+ # Rake::GemPackageTask.new(spec) do |pkg|
105
+ # pkg.gem_spec = spec
106
+ # end
107
+ #
108
+ # desc "create a gemspec file"
109
+ # task :make_spec do
110
+ # ::File.unlink "#{GEM_NAME.downcase}.gemspec" if ::File.exists?("#{GEM_NAME.downcase}.gemspec")
111
+ # ::File.open("#{GEM_NAME.downcase}.gemspec", "w+") do |file|
112
+ # file.puts spec.to_ruby
113
+ # end
114
+ # end