calas-capitate 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/Capfile +13 -0
  2. data/History.txt +167 -0
  3. data/License.txt +20 -0
  4. data/Manifest.txt +121 -0
  5. data/README.txt +8 -0
  6. data/Rakefile +4 -0
  7. data/config/hoe.rb +72 -0
  8. data/config/requirements.rb +17 -0
  9. data/lib/capitate.rb +56 -0
  10. data/lib/capitate/cap_ext/connections.rb +105 -0
  11. data/lib/capitate/cap_ext/docs.rb +26 -0
  12. data/lib/capitate/cap_ext/namespace.rb +34 -0
  13. data/lib/capitate/cap_ext/run_via.rb +16 -0
  14. data/lib/capitate/cap_ext/task_definition.rb +22 -0
  15. data/lib/capitate/cap_ext/variables.rb +132 -0
  16. data/lib/capitate/plugins/base.rb +140 -0
  17. data/lib/capitate/plugins/build.rb +71 -0
  18. data/lib/capitate/plugins/gem.rb +24 -0
  19. data/lib/capitate/plugins/prompt.rb +109 -0
  20. data/lib/capitate/plugins/rake.rb +25 -0
  21. data/lib/capitate/plugins/script.rb +96 -0
  22. data/lib/capitate/plugins/templates.rb +113 -0
  23. data/lib/capitate/plugins/utils.rb +151 -0
  24. data/lib/capitate/plugins/yum.rb +76 -0
  25. data/lib/capitate/recipes.rb +5 -0
  26. data/lib/capitate/task_node.rb +262 -0
  27. data/lib/capitate/version.rb +9 -0
  28. data/lib/deployment/centos-5.1-64-web/install.rb +196 -0
  29. data/lib/recipes/active_record.rb +36 -0
  30. data/lib/recipes/apache.rb +47 -0
  31. data/lib/recipes/backgroundrb.rb +29 -0
  32. data/lib/recipes/centos/backgroundjob.rb +27 -0
  33. data/lib/recipes/centos/backgroundrb.rb +23 -0
  34. data/lib/recipes/centos/centos.rb +45 -0
  35. data/lib/recipes/centos/imagemagick.rb +29 -0
  36. data/lib/recipes/centos/memcached.rb +45 -0
  37. data/lib/recipes/centos/merb.rb +23 -0
  38. data/lib/recipes/centos/mongrel_cluster.rb +54 -0
  39. data/lib/recipes/centos/monit.rb +62 -0
  40. data/lib/recipes/centos/mysql.rb +25 -0
  41. data/lib/recipes/centos/nginx.rb +64 -0
  42. data/lib/recipes/centos/ruby.rb +40 -0
  43. data/lib/recipes/centos/sphinx.rb +59 -0
  44. data/lib/recipes/docs.rb +24 -0
  45. data/lib/recipes/logrotate/backgroundjob.rb +26 -0
  46. data/lib/recipes/logrotate/backgroundrb.rb +26 -0
  47. data/lib/recipes/logrotate/merb.rb +25 -0
  48. data/lib/recipes/logrotate/mongrel_cluster.rb +29 -0
  49. data/lib/recipes/logrotate/monit.rb +28 -0
  50. data/lib/recipes/logrotate/mysql.rb +26 -0
  51. data/lib/recipes/logrotate/nginx.rb +37 -0
  52. data/lib/recipes/logrotate/rails.rb +21 -0
  53. data/lib/recipes/logrotate/sphinx.rb +21 -0
  54. data/lib/recipes/logrotated.rb +61 -0
  55. data/lib/recipes/memcached.rb +26 -0
  56. data/lib/recipes/merb.rb +32 -0
  57. data/lib/recipes/monit.rb +35 -0
  58. data/lib/recipes/monit/backgroundjob.rb +38 -0
  59. data/lib/recipes/monit/backgroundrb.rb +38 -0
  60. data/lib/recipes/monit/database.rb +25 -0
  61. data/lib/recipes/monit/memcached.rb +22 -0
  62. data/lib/recipes/monit/merb.rb +58 -0
  63. data/lib/recipes/monit/mongrel_cluster.rb +85 -0
  64. data/lib/recipes/monit/mysql.rb +20 -0
  65. data/lib/recipes/monit/nginx.rb +37 -0
  66. data/lib/recipes/monit/sphinx.rb +38 -0
  67. data/lib/recipes/monit/sshd.rb +27 -0
  68. data/lib/recipes/mysql.rb +42 -0
  69. data/lib/recipes/nginx.rb +29 -0
  70. data/lib/recipes/rails.rb +71 -0
  71. data/lib/recipes/redmine.rb +38 -0
  72. data/lib/recipes/sphinx.rb +60 -0
  73. data/lib/recipes/sshd.rb +47 -0
  74. data/lib/recipes/syslogd.rb +21 -0
  75. data/lib/templates/apache/vhost.mongrel_cluster.conf.erb +46 -0
  76. data/lib/templates/backgroundjob/backgroundjob.initd.centos.erb +54 -0
  77. data/lib/templates/backgroundjob/backgroundjob.monitrc.erb +3 -0
  78. data/lib/templates/backgroundrb/backgroundrb.initd.centos.erb +58 -0
  79. data/lib/templates/backgroundrb/backgroundrb.monitrc.erb +3 -0
  80. data/lib/templates/backgroundrb/backgroundrb.yml.erb +14 -0
  81. data/lib/templates/capistrano/Capfile +22 -0
  82. data/lib/templates/logrotated/conf.erb +3 -0
  83. data/lib/templates/memcached/memcached.initd.centos.erb +58 -0
  84. data/lib/templates/memcached/memcached.monitrc.erb +4 -0
  85. data/lib/templates/memcached/memcached.yml.erb +14 -0
  86. data/lib/templates/merb/merb-no-http.monitrc.erb +13 -0
  87. data/lib/templates/merb/merb.initd.centos.erb +123 -0
  88. data/lib/templates/merb/merb.monitrc.erb +15 -0
  89. data/lib/templates/mongrel/mongrel_cluster.initd.centos.erb +94 -0
  90. data/lib/templates/mongrel/mongrel_cluster.monitrc.erb +15 -0
  91. data/lib/templates/mongrel/mongrel_cluster.yml.erb +11 -0
  92. data/lib/templates/monit/monit.cnf +34 -0
  93. data/lib/templates/monit/monit.initd.centos.erb +68 -0
  94. data/lib/templates/monit/monitrc.erb +18 -0
  95. data/lib/templates/mysql/install_db.sql.erb +6 -0
  96. data/lib/templates/mysql/my.cnf.innodb_1024.erb +122 -0
  97. data/lib/templates/mysql/my.cnf.innodb_512.erb +127 -0
  98. data/lib/templates/mysql/mysql.monitrc.erb +6 -0
  99. data/lib/templates/nginx/nginx.conf.erb +97 -0
  100. data/lib/templates/nginx/nginx.initd.centos.erb +69 -0
  101. data/lib/templates/nginx/nginx.monitrc.erb +4 -0
  102. data/lib/templates/nginx/nginx_vhost.conf.erb +101 -0
  103. data/lib/templates/nginx/nginx_vhost_generic.conf.erb +99 -0
  104. data/lib/templates/rails/database.yml.erb +7 -0
  105. data/lib/templates/redmine/email.yml.erb +10 -0
  106. data/lib/templates/ruby/fix_openssl.sh +12 -0
  107. data/lib/templates/sphinx/sphinx.conf.erb +157 -0
  108. data/lib/templates/sphinx/sphinx.monitrc.erb +4 -0
  109. data/lib/templates/sphinx/sphinx_app.initd.centos.erb +90 -0
  110. data/lib/templates/sshd/sshd.monitrc.erb +5 -0
  111. data/script/destroy +14 -0
  112. data/script/generate +14 -0
  113. data/script/txt2html +80 -0
  114. data/setup.rb +1585 -0
  115. data/tasks/deployment.rake +34 -0
  116. data/tasks/environment.rake +7 -0
  117. data/tasks/website.rake +23 -0
  118. data/test/test_helper.rb +2 -0
  119. data/test/test_plugin_upload.rb +32 -0
  120. data/test/test_recipes.rb +37 -0
  121. data/test/test_templates.rb +29 -0
  122. metadata +198 -0
@@ -0,0 +1,34 @@
1
+ desc 'Release the website and new gem version'
2
+ task :deploy => [:check_version, :website, :release] do
3
+ puts "Remember to create SVN tag:"
4
+ puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
+ "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
+ puts "Suggested comment:"
7
+ puts "Tagging release #{CHANGES}"
8
+ end
9
+
10
+ desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
+ task :local_deploy => [:website_generate, :install_gem]
12
+
13
+ task :check_version do
14
+ unless ENV['VERSION']
15
+ puts 'Must pass a VERSION=x.y.z release version'
16
+ exit
17
+ end
18
+ unless ENV['VERSION'] == VERS
19
+ puts "Please update your version.rb to match the release version, currently #{VERS}"
20
+ exit
21
+ end
22
+ end
23
+
24
+ desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
+ task :install_gem_no_doc => [:clean, :package] do
26
+ sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
+ end
28
+
29
+ namespace :manifest do
30
+ desc 'Recreate Manifest.txt to include ALL files'
31
+ task :refresh do
32
+ `rake check_manifest | patch -p0 > Manifest.txt`
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ task :ruby_env do
2
+ RUBY_APP = if RUBY_PLATFORM =~ /java/
3
+ "jruby"
4
+ else
5
+ "ruby"
6
+ end unless defined? RUBY_APP
7
+ end
@@ -0,0 +1,23 @@
1
+ desc 'Generate website files'
2
+ task :website_generate => :ruby_env do
3
+ template = File.join(File.dirname(__FILE__), '/../website/template.rhtml')
4
+ sh %{ #{RUBY_APP} script/txt2html "website/**/*.txt" #{template} website }
5
+
6
+ # Clean and re-create
7
+ FileUtils.rm_rf("website/recipes")
8
+ FileUtils.mkdir_p("website/recipes")
9
+ sh "cap docs:recipes"
10
+ template = File.join(File.dirname(__FILE__), '/../website/template_recipe.rhtml')
11
+ sh %{ #{RUBY_APP} script/txt2html "docs/recipes/**/*.txt" #{template} website/recipes }
12
+ end
13
+
14
+ desc 'Upload website files to rubyforge'
15
+ task :website_upload do
16
+ host = "#{rubyforge_username}@rubyforge.org"
17
+ remote_dir = "/var/www/gforge-projects/#{PATH}/"
18
+ local_dir = 'website'
19
+ sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
20
+ end
21
+
22
+ desc 'Generate and upload website files'
23
+ task :website => [:website_generate, :website_upload, :publish_docs]
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/capitate'
@@ -0,0 +1,32 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestPluginUpload < Test::Unit::TestCase
4
+
5
+ include Capitate::Plugins::Upload
6
+
7
+ # Mocked put
8
+ def put(data, dest_path, options)
9
+ start = 0
10
+ length = 4096
11
+
12
+ @mock_put << data[start, length]
13
+ end
14
+
15
+ # Test upload streamed
16
+ def test_upload
17
+ @mock_put = ""
18
+
19
+ # Use this file for data
20
+ path = __FILE__
21
+
22
+ file(path, "mocked")
23
+
24
+ data = nil
25
+ File.open(__FILE__) { |f| data = f.readlines }
26
+ data = data.join
27
+
28
+ assert_equal data, @mock_put
29
+ end
30
+
31
+ end
32
+
@@ -0,0 +1,37 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestRecipes < Test::Unit::TestCase
4
+
5
+ def test_egrep
6
+ # task :test_egrep do
7
+ # role :test, "10.0.6.118", :user => "root"
8
+ #
9
+ # found = utils.egrep("^mail.\\*", "/etc/syslog.conf")
10
+ # puts "Found? #{found}"
11
+ #
12
+ # found = utils.egrep("^fooo", "/etc/syslog.conf")
13
+ # puts "Found? #{found}"
14
+ # end
15
+ assert true
16
+ end
17
+
18
+ def test_app
19
+ # task :test_app do
20
+ # set :application, "sick"
21
+ # set :deploy_to, "/var/www/apps/sick"
22
+ # role :web, "10.0.6.118", :user => "root"
23
+ # role :app, "10.0.6.118", :user => "root"
24
+ # end
25
+ assert true
26
+ end
27
+
28
+ def test_install
29
+ # task :test_install do
30
+ # load File.dirname(__FILE__) + "/lib/deployment/centos-5.1-64-web/install.rb"
31
+ # role :test, "10.0.6.118", :user => "root"
32
+ # end
33
+ assert true
34
+ end
35
+
36
+ end
37
+
@@ -0,0 +1,29 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestTemplates < Test::Unit::TestCase
4
+
5
+ TmpDir = File.dirname(__FILE__) + "/tmp"
6
+
7
+ def setup
8
+ FileUtils.mkdir(TmpDir)
9
+ end
10
+
11
+ def teardown
12
+ FileUtils.rm_rf(TmpDir)
13
+ end
14
+
15
+ def test_write
16
+ TemplatesPlugin.write("capistrano/Capfile", "#{TmpDir}/Capfile")
17
+
18
+ lines = ""
19
+ File.open("#{TmpDir}/Capfile") { |f| lines = f.readlines }
20
+ assert lines.length > 0
21
+ end
22
+
23
+ end
24
+
25
+ class TemplatesPlugin
26
+ class << self
27
+ include Capitate::Plugins::Templates
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,198 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: calas-capitate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.6
5
+ platform: ruby
6
+ authors:
7
+ - Gabriel Handford
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-23 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.1.0
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: hoe
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 1.8.0
32
+ version:
33
+ description: Capistrano recipes, plugins and templates.
34
+ email:
35
+ - gabrielh@gmail.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files:
41
+ - History.txt
42
+ - License.txt
43
+ - Manifest.txt
44
+ - README.txt
45
+ files:
46
+ - Capfile
47
+ - History.txt
48
+ - License.txt
49
+ - Manifest.txt
50
+ - README.txt
51
+ - Rakefile
52
+ - config/hoe.rb
53
+ - config/requirements.rb
54
+ - lib/capitate.rb
55
+ - lib/capitate/cap_ext/connections.rb
56
+ - lib/capitate/cap_ext/docs.rb
57
+ - lib/capitate/cap_ext/namespace.rb
58
+ - lib/capitate/cap_ext/run_via.rb
59
+ - lib/capitate/cap_ext/task_definition.rb
60
+ - lib/capitate/cap_ext/variables.rb
61
+ - lib/capitate/plugins/base.rb
62
+ - lib/capitate/plugins/build.rb
63
+ - lib/capitate/plugins/gem.rb
64
+ - lib/capitate/plugins/rake.rb
65
+ - lib/capitate/plugins/prompt.rb
66
+ - lib/capitate/plugins/script.rb
67
+ - lib/capitate/plugins/templates.rb
68
+ - lib/capitate/plugins/utils.rb
69
+ - lib/capitate/plugins/yum.rb
70
+ - lib/capitate/recipes.rb
71
+ - lib/capitate/task_node.rb
72
+ - lib/capitate/version.rb
73
+ - lib/deployment/centos-5.1-64-web/install.rb
74
+ - lib/recipes/active_record.rb
75
+ - lib/recipes/apache.rb
76
+ - lib/recipes/backgroundrb.rb
77
+ - lib/recipes/centos/backgroundjob.rb
78
+ - lib/recipes/centos/backgroundrb.rb
79
+ - lib/recipes/centos/centos.rb
80
+ - lib/recipes/centos/imagemagick.rb
81
+ - lib/recipes/centos/memcached.rb
82
+ - lib/recipes/centos/merb.rb
83
+ - lib/recipes/centos/mongrel_cluster.rb
84
+ - lib/recipes/centos/monit.rb
85
+ - lib/recipes/centos/mysql.rb
86
+ - lib/recipes/centos/nginx.rb
87
+ - lib/recipes/centos/ruby.rb
88
+ - lib/recipes/centos/sphinx.rb
89
+ - lib/recipes/docs.rb
90
+ - lib/recipes/logrotate/backgroundjob.rb
91
+ - lib/recipes/logrotate/backgroundrb.rb
92
+ - lib/recipes/logrotate/merb.rb
93
+ - lib/recipes/logrotate/mongrel_cluster.rb
94
+ - lib/recipes/logrotate/monit.rb
95
+ - lib/recipes/logrotate/mysql.rb
96
+ - lib/recipes/logrotate/nginx.rb
97
+ - lib/recipes/logrotate/rails.rb
98
+ - lib/recipes/logrotate/sphinx.rb
99
+ - lib/recipes/logrotated.rb
100
+ - lib/recipes/memcached.rb
101
+ - lib/recipes/merb.rb
102
+ - lib/recipes/monit.rb
103
+ - lib/recipes/monit/backgroundjob.rb
104
+ - lib/recipes/monit/backgroundrb.rb
105
+ - lib/recipes/monit/database.rb
106
+ - lib/recipes/monit/memcached.rb
107
+ - lib/recipes/monit/merb.rb
108
+ - lib/recipes/monit/mongrel_cluster.rb
109
+ - lib/recipes/monit/mysql.rb
110
+ - lib/recipes/monit/nginx.rb
111
+ - lib/recipes/monit/sphinx.rb
112
+ - lib/recipes/monit/sshd.rb
113
+ - lib/recipes/mysql.rb
114
+ - lib/recipes/nginx.rb
115
+ - lib/recipes/rails.rb
116
+ - lib/recipes/redmine.rb
117
+ - lib/recipes/sphinx.rb
118
+ - lib/recipes/sshd.rb
119
+ - lib/recipes/syslogd.rb
120
+ - lib/templates/apache/vhost.mongrel_cluster.conf.erb
121
+ - lib/templates/backgroundjob/backgroundjob.initd.centos.erb
122
+ - lib/templates/backgroundjob/backgroundjob.monitrc.erb
123
+ - lib/templates/backgroundrb/backgroundrb.initd.centos.erb
124
+ - lib/templates/backgroundrb/backgroundrb.monitrc.erb
125
+ - lib/templates/backgroundrb/backgroundrb.yml.erb
126
+ - lib/templates/capistrano/Capfile
127
+ - lib/templates/logrotated/conf.erb
128
+ - lib/templates/memcached/memcached.initd.centos.erb
129
+ - lib/templates/memcached/memcached.monitrc.erb
130
+ - lib/templates/memcached/memcached.yml.erb
131
+ - lib/templates/merb/merb-no-http.monitrc.erb
132
+ - lib/templates/merb/merb.initd.centos.erb
133
+ - lib/templates/merb/merb.monitrc.erb
134
+ - lib/templates/mongrel/mongrel_cluster.initd.centos.erb
135
+ - lib/templates/mongrel/mongrel_cluster.monitrc.erb
136
+ - lib/templates/mongrel/mongrel_cluster.yml.erb
137
+ - lib/templates/monit/monit.cnf
138
+ - lib/templates/monit/monit.initd.centos.erb
139
+ - lib/templates/monit/monitrc.erb
140
+ - lib/templates/mysql/install_db.sql.erb
141
+ - lib/templates/mysql/my.cnf.innodb_1024.erb
142
+ - lib/templates/mysql/my.cnf.innodb_512.erb
143
+ - lib/templates/mysql/mysql.monitrc.erb
144
+ - lib/templates/nginx/nginx.conf.erb
145
+ - lib/templates/nginx/nginx.initd.centos.erb
146
+ - lib/templates/nginx/nginx.monitrc.erb
147
+ - lib/templates/nginx/nginx_vhost.conf.erb
148
+ - lib/templates/nginx/nginx_vhost_generic.conf.erb
149
+ - lib/templates/rails/database.yml.erb
150
+ - lib/templates/redmine/email.yml.erb
151
+ - lib/templates/ruby/fix_openssl.sh
152
+ - lib/templates/sphinx/sphinx.conf.erb
153
+ - lib/templates/sphinx/sphinx.monitrc.erb
154
+ - lib/templates/sphinx/sphinx_app.initd.centos.erb
155
+ - lib/templates/sshd/sshd.monitrc.erb
156
+ - script/destroy
157
+ - script/generate
158
+ - script/txt2html
159
+ - setup.rb
160
+ - tasks/deployment.rake
161
+ - tasks/environment.rake
162
+ - tasks/website.rake
163
+ - test/test_helper.rb
164
+ - test/test_plugin_upload.rb
165
+ - test/test_recipes.rb
166
+ - test/test_templates.rb
167
+ has_rdoc: true
168
+ homepage: http://capitate.rubyforge.org
169
+ post_install_message:
170
+ rdoc_options:
171
+ - --main
172
+ - README.txt
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: "0"
180
+ version:
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: "0"
186
+ version:
187
+ requirements: []
188
+
189
+ rubyforge_project: capitate
190
+ rubygems_version: 1.2.0
191
+ signing_key:
192
+ specification_version: 2
193
+ summary: Capistrano recipes, plugins and templates.
194
+ test_files:
195
+ - test/test_helper.rb
196
+ - test/test_plugin_upload.rb
197
+ - test/test_recipes.rb
198
+ - test/test_templates.rb