nesquena-cap-recipes 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{README.txt → README.textile} +28 -24
- data/Rakefile +48 -4
- data/lib/cap_recipes/tasks/passenger.rb +38 -3
- data/spec/cap-recipes-spec.rb +5 -0
- metadata +17 -44
- data/History.txt +0 -4
- data/License.txt +0 -20
- data/Manifest.txt +0 -28
- data/config/hoe.rb +0 -73
- data/config/requirements.rb +0 -15
- data/lib/cap_recipes/version.rb +0 -9
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -82
- data/setup.rb +0 -1585
- data/tasks/environment.rake +0 -7
- data/tasks/website.rake +0 -17
- data/test/test_cap_recipes.rb +0 -11
- data/test/test_helper.rb +0 -2
- data/website/index.html +0 -141
- data/website/index.txt +0 -83
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -138
- data/website/template.html.erb +0 -48
@@ -1,26 +1,33 @@
|
|
1
|
-
|
1
|
+
h1. cap-recipes
|
2
2
|
|
3
|
-
|
3
|
+
h2. INSTALLATION
|
4
4
|
|
5
|
-
|
5
|
+
* gem sources -a http://gems.github.com/
|
6
|
+
* sudo gem install nesquena-cap-recipes
|
7
|
+
|
8
|
+
h2. DESCRIPTION
|
9
|
+
|
10
|
+
This is a collection of capistrano recipes which will grow to encompass many useful recipes. The intended use for these recipes is for a rails project which deploys using the Phusion Passenger module of Apache. In addition, recipes for the management of various daemon processes will be included as needed. Feel free to contribute to this and make it better!
|
11
|
+
|
12
|
+
Currently included:
|
6
13
|
|
7
14
|
* Phusion Passenger (Setup and Deployment)
|
8
|
-
* Apache Server
|
9
|
-
* Juggernaut
|
10
|
-
* Backgroundrb
|
15
|
+
* Apache Server
|
16
|
+
* Juggernaut Daemon
|
17
|
+
* Backgroundrb Server
|
11
18
|
|
12
|
-
|
19
|
+
h2. SYNOPSIS
|
13
20
|
|
14
21
|
To include any of these into your deploy.rb configuration file for Capistrano:
|
15
22
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
require 'cap_recipes/tasks/passenger'
|
24
|
+
require 'cap_recipes/tasks/apache'
|
25
|
+
require 'cap_recipes/tasks/backgroundrb'
|
26
|
+
require 'cap_recipes/tasks/juggernaut'
|
27
|
+
|
28
|
+
h2. USAGE
|
22
29
|
|
23
|
-
Passenger
|
30
|
+
h3. Passenger
|
24
31
|
|
25
32
|
deploy
|
26
33
|
:stop
|
@@ -34,7 +41,8 @@ Passenger
|
|
34
41
|
:cache
|
35
42
|
:log
|
36
43
|
|
37
|
-
Apache
|
44
|
+
h3. Apache
|
45
|
+
|
38
46
|
variables: apache_init_path
|
39
47
|
tasks:
|
40
48
|
apache
|
@@ -43,7 +51,8 @@ Apache
|
|
43
51
|
:restart
|
44
52
|
:install
|
45
53
|
|
46
|
-
Backgroundrb
|
54
|
+
h3. Backgroundrb
|
55
|
+
|
47
56
|
variables: backgroundrb_log
|
48
57
|
tasks:
|
49
58
|
backgroundrb
|
@@ -53,8 +62,8 @@ Backgroundrb
|
|
53
62
|
:copy_config
|
54
63
|
:tail
|
55
64
|
|
56
|
-
Juggernaut
|
57
|
-
|
65
|
+
h3. Juggernaut
|
66
|
+
|
58
67
|
variables: juggernaut_config, juggernaut_pid, juggernaut_log
|
59
68
|
tasks:
|
60
69
|
juggernaut
|
@@ -64,12 +73,7 @@ Juggernaut
|
|
64
73
|
:copy_config
|
65
74
|
:tail
|
66
75
|
|
67
|
-
|
68
|
-
|
69
|
-
* gem sources -a http://gems.github.com/
|
70
|
-
* sudo gem install xgamerx-cap-recipes
|
71
|
-
|
72
|
-
== LICENSE:
|
76
|
+
h2. LICENSE:
|
73
77
|
|
74
78
|
(The MIT License)
|
75
79
|
|
data/Rakefile
CHANGED
@@ -1,4 +1,48 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
|
4
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubygems/specification'
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
require 'spec/rake/spectask'
|
6
|
+
|
7
|
+
GEM = "cap-recipes"
|
8
|
+
GEM_VERSION = "0.2.0"
|
9
|
+
SUMMARY = "Collection of capistrano recipes for apache, passenger, juggernaut and backgroundrb"
|
10
|
+
AUTHOR = "Nathan Esquenazi"
|
11
|
+
EMAIL = "nesquena@gmail.com"
|
12
|
+
HOMEPAGE = "http://caprecipes.rubyforge.org"
|
13
|
+
|
14
|
+
spec = Gem::Specification.new do |s|
|
15
|
+
s.name = GEM
|
16
|
+
s.version = GEM_VERSION
|
17
|
+
s.platform = Gem::Platform::RUBY
|
18
|
+
s.summary = SUMMARY
|
19
|
+
s.require_paths = ['lib']
|
20
|
+
s.files = FileList['[A-Z]*', 'lib/**/*.rb', 'spec/**/*'].to_a
|
21
|
+
|
22
|
+
s.author = AUTHOR
|
23
|
+
s.email = EMAIL
|
24
|
+
s.homepage = HOMEPAGE
|
25
|
+
|
26
|
+
s.rubyforge_project = GEM # GitHub bug, gem isn't being build when this miss
|
27
|
+
end
|
28
|
+
|
29
|
+
Spec::Rake::SpecTask.new do |t|
|
30
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
31
|
+
t.spec_opts = %w(-fs --color)
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
35
|
+
pkg.gem_spec = spec
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Install the gem locally"
|
39
|
+
task :install => [:package] do
|
40
|
+
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Create a gemspec file"
|
44
|
+
task :make_spec do
|
45
|
+
File.open("#{GEM}.gemspec", "w") do |file|
|
46
|
+
file.puts spec.to_ruby
|
47
|
+
end
|
48
|
+
end
|
@@ -62,10 +62,45 @@ Capistrano::Configuration.instance(true).load do
|
|
62
62
|
# INSTALLATION
|
63
63
|
# ===============================================================
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
desc "Installs Phusion Passenger"
|
66
|
+
task :install_passenger, :role => :app do
|
67
|
+
puts 'Installing passenger module'
|
68
|
+
deploy.passenger_module
|
69
|
+
deploy.config_passenger
|
68
70
|
end
|
71
|
+
|
72
|
+
desc "Setup Passenger Module"
|
73
|
+
task :passenger_module do
|
74
|
+
sudo "gem install passenger --no-ri --no-rdoc"
|
75
|
+
input = ''
|
76
|
+
run "sudo passenger-install-apache2-module" do |ch, stream, out|
|
77
|
+
next if out.chomp == input.chomp || out.chomp == ''
|
78
|
+
print out
|
79
|
+
ch.send_data(input = $stdin.gets) if out =~ /(Enter|ENTER)/
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "Configure Passenger"
|
84
|
+
task :config_passenger do
|
85
|
+
version = 'ERROR' # default
|
86
|
+
|
87
|
+
# passenger (2.X.X, 1.X.X)
|
88
|
+
run("gem list | grep passenger") do |ch, stream, data|
|
89
|
+
version = data.sub(/passenger \(([^,]+).*/,"\\1").strip
|
90
|
+
end
|
91
|
+
|
92
|
+
puts " passenger version #{version} configured"
|
93
|
+
|
94
|
+
passenger_config =<<-EOF
|
95
|
+
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-#{version}/ext/apache2/mod_passenger.so
|
96
|
+
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-#{version}
|
97
|
+
PassengerRuby /usr/bin/ruby1.8
|
98
|
+
EOF
|
99
|
+
|
100
|
+
put passenger_config, "src/passenger"
|
101
|
+
sudo "mv src/passenger /etc/apache2/conf.d/passenger"
|
102
|
+
end
|
103
|
+
|
69
104
|
end
|
70
105
|
|
71
106
|
# ===============================================================
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nesquena-cap-recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Esquenazi
|
@@ -9,58 +9,32 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-16 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
17
|
-
email:
|
18
|
-
- xgamerx10@gmail.com
|
16
|
+
description:
|
17
|
+
email: nesquena@gmail.com
|
19
18
|
executables: []
|
20
19
|
|
21
20
|
extensions: []
|
22
21
|
|
23
|
-
extra_rdoc_files:
|
24
|
-
|
25
|
-
- License.txt
|
26
|
-
- Manifest.txt
|
27
|
-
- README.txt
|
28
|
-
- website/index.txt
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
29
24
|
files:
|
30
|
-
- History.txt
|
31
|
-
- License.txt
|
32
|
-
- Manifest.txt
|
33
|
-
- README.txt
|
34
25
|
- Rakefile
|
35
|
-
-
|
36
|
-
- config/requirements.rb
|
37
|
-
- lib/cap_recipes.rb
|
38
|
-
- lib/cap_recipes/version.rb
|
26
|
+
- README.textile
|
39
27
|
- lib/cap_recipes/tasks/apache.rb
|
40
28
|
- lib/cap_recipes/tasks/backgroundrb.rb
|
41
29
|
- lib/cap_recipes/tasks/juggernaut.rb
|
42
30
|
- lib/cap_recipes/tasks/passenger.rb
|
43
|
-
-
|
44
|
-
-
|
45
|
-
|
46
|
-
- script/txt2html
|
47
|
-
- setup.rb
|
48
|
-
- tasks/development.rake
|
49
|
-
- tasks/environment.rake
|
50
|
-
- tasks/website.rake
|
51
|
-
- test/test_cap_recipes.rb
|
52
|
-
- test/test_helper.rb
|
53
|
-
- website/index.html
|
54
|
-
- website/index.txt
|
55
|
-
- website/javascripts/rounded_corners_lite.inc.js
|
56
|
-
- website/stylesheets/screen.css
|
57
|
-
- website/template.html.erb
|
58
|
-
has_rdoc: true
|
31
|
+
- lib/cap_recipes.rb
|
32
|
+
- spec/cap-recipes-spec.rb
|
33
|
+
has_rdoc: false
|
59
34
|
homepage: http://caprecipes.rubyforge.org
|
60
|
-
post_install_message:
|
61
|
-
rdoc_options:
|
62
|
-
|
63
|
-
- README.txt
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
|
64
38
|
require_paths:
|
65
39
|
- lib
|
66
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -77,11 +51,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
51
|
version:
|
78
52
|
requirements: []
|
79
53
|
|
80
|
-
rubyforge_project:
|
54
|
+
rubyforge_project: cap-recipes
|
81
55
|
rubygems_version: 1.2.0
|
82
56
|
signing_key:
|
83
57
|
specification_version: 2
|
84
|
-
summary:
|
85
|
-
test_files:
|
86
|
-
|
87
|
-
- test/test_helper.rb
|
58
|
+
summary: Collection of capistrano recipes for apache, passenger, juggernaut and backgroundrb
|
59
|
+
test_files: []
|
60
|
+
|
data/History.txt
DELETED
data/License.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2008 FIXME full name
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
History.txt
|
2
|
-
License.txt
|
3
|
-
Manifest.txt
|
4
|
-
README.txt
|
5
|
-
Rakefile
|
6
|
-
config/hoe.rb
|
7
|
-
config/requirements.rb
|
8
|
-
lib/cap_recipes.rb
|
9
|
-
lib/cap_recipes/version.rb
|
10
|
-
lib/cap_recipes/tasks/apache.rb
|
11
|
-
lib/cap_recipes/tasks/backgroundrb.rb
|
12
|
-
lib/cap_recipes/tasks/juggernaut.rb
|
13
|
-
lib/cap_recipes/tasks/passenger.rb
|
14
|
-
script/console
|
15
|
-
script/destroy
|
16
|
-
script/generate
|
17
|
-
script/txt2html
|
18
|
-
setup.rb
|
19
|
-
tasks/development.rake
|
20
|
-
tasks/environment.rake
|
21
|
-
tasks/website.rake
|
22
|
-
test/test_cap_recipes.rb
|
23
|
-
test/test_helper.rb
|
24
|
-
website/index.html
|
25
|
-
website/index.txt
|
26
|
-
website/javascripts/rounded_corners_lite.inc.js
|
27
|
-
website/stylesheets/screen.css
|
28
|
-
website/template.html.erb
|
data/config/hoe.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'cap_recipes/version'
|
2
|
-
|
3
|
-
AUTHOR = 'Nathan Esquenazi' # can also be an array of Authors
|
4
|
-
EMAIL = "xgamerx10@gmail.com"
|
5
|
-
DESCRIPTION = "My collection of capistrano recipes"
|
6
|
-
GEM_NAME = 'cap-recipes' # what ppl will type to install your gem
|
7
|
-
RUBYFORGE_PROJECT = 'caprecipes' # The unix name for your project
|
8
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
-
EXTRA_DEPENDENCIES = [
|
11
|
-
['capistrano', '>= 2.2.0']
|
12
|
-
]
|
13
|
-
|
14
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
15
|
-
@config = nil
|
16
|
-
RUBYFORGE_USERNAME = "nesquena"
|
17
|
-
def rubyforge_username
|
18
|
-
unless @config
|
19
|
-
begin
|
20
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
21
|
-
rescue
|
22
|
-
puts <<-EOS
|
23
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
24
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
25
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
26
|
-
EOS
|
27
|
-
exit
|
28
|
-
end
|
29
|
-
end
|
30
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
REV = nil
|
35
|
-
# UNCOMMENT IF REQUIRED:
|
36
|
-
# REV = YAML.load(`svn info`)['Revision']
|
37
|
-
VERS = CapRecipes::VERSION::STRING + (REV ? ".#{REV}" : "")
|
38
|
-
RDOC_OPTS = ['--quiet', '--title', 'cap_recipes documentation',
|
39
|
-
"--opname", "index.html",
|
40
|
-
"--line-numbers",
|
41
|
-
"--main", "README",
|
42
|
-
"--inline-source"]
|
43
|
-
|
44
|
-
class Hoe
|
45
|
-
def extra_deps
|
46
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
47
|
-
@extra_deps
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Generate all the Rake tasks
|
52
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
53
|
-
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
54
|
-
p.developer(AUTHOR, EMAIL)
|
55
|
-
p.description = DESCRIPTION
|
56
|
-
p.summary = DESCRIPTION
|
57
|
-
p.url = HOMEPATH
|
58
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
59
|
-
p.test_globs = ["test/**/test_*.rb"]
|
60
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
61
|
-
|
62
|
-
# == Optional
|
63
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
64
|
-
#p.extra_deps = EXTRA_DEPENDENCIES
|
65
|
-
|
66
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
|
-
end
|
68
|
-
|
69
|
-
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
70
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
71
|
-
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
72
|
-
$hoe.rsync_args = '-av --delete --ignore-errors'
|
73
|
-
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
data/config/requirements.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|