capitate 0.3.5 → 0.3.6
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/History.txt +10 -0
- data/Manifest.txt +3 -9
- data/lib/capitate.rb +14 -0
- data/lib/capitate/cap_ext/namespace.rb +34 -0
- data/lib/capitate/cap_ext/task_definition.rb +22 -0
- data/lib/capitate/task_node.rb +21 -1
- data/lib/capitate/version.rb +1 -1
- data/lib/recipes/active_record.rb +7 -36
- data/lib/recipes/backgroundrb.rb +4 -19
- data/lib/recipes/centos/backgroundjob.rb +5 -26
- data/lib/recipes/centos/backgroundrb.rb +2 -13
- data/lib/recipes/centos/centos.rb +4 -26
- data/lib/recipes/centos/imagemagick.rb +8 -9
- data/lib/recipes/centos/memcached.rb +12 -53
- data/lib/recipes/centos/merb.rb +7 -33
- data/lib/recipes/centos/mongrel_cluster.rb +15 -51
- data/lib/recipes/centos/monit.rb +10 -36
- data/lib/recipes/centos/mysql.rb +1 -10
- data/lib/recipes/centos/nginx.rb +14 -42
- data/lib/recipes/centos/ruby.rb +6 -15
- data/lib/recipes/centos/sphinx.rb +13 -36
- data/lib/recipes/docs.rb +2 -14
- data/lib/recipes/logrotated.rb +20 -40
- data/lib/recipes/memcached.rb +10 -41
- data/lib/recipes/merb.rb +3 -4
- data/lib/recipes/monit.rb +4 -23
- data/lib/recipes/monit/merb.rb +7 -12
- data/lib/recipes/monit/mysql.rb +3 -19
- data/lib/recipes/monit/nginx.rb +2 -16
- data/lib/recipes/monit/sphinx.rb +20 -11
- data/lib/recipes/mysql.rb +13 -53
- data/lib/recipes/nginx.rb +9 -65
- data/lib/recipes/rails.rb +0 -58
- data/lib/recipes/sphinx.rb +20 -46
- data/lib/recipes/sshd.rb +6 -15
- data/lib/recipes/syslogd.rb +3 -43
- data/lib/templates/backgroundjob/backgroundjob.initd.centos.erb +4 -4
- data/lib/templates/merb/merb-no-http.monitrc.erb +13 -0
- data/lib/templates/merb/merb.initd.centos.erb +3 -3
- metadata +5 -12
- data/docs/nginx.README +0 -12
- data/website/index.html +0 -154
- data/website/index.txt +0 -69
- data/website/javascripts/code_highlighter.js +0 -188
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/javascripts/ruby.js +0 -18
- data/website/stylesheets/screen.css +0 -265
- data/website/template.rhtml +0 -69
- data/website/template_recipe.rhtml +0 -44
data/History.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
== 0.3.6 ?
|
2
|
+
|
3
|
+
* Fixing backgroundjob to use --daemon
|
4
|
+
* Fixing merb init to use daemon init function on start (then it plays nice with monit)
|
5
|
+
* Fixing backgroundjob init (BIN_PATH error)
|
6
|
+
* Adding --log to backgroundjob init.d
|
7
|
+
* Fixing sphinx monit start/stop/restart
|
8
|
+
* Adding task arguments to DSL
|
9
|
+
* Updating most of the documentation to pull from task args
|
10
|
+
|
1
11
|
== 0.3.5 2008-05-08
|
2
12
|
|
3
13
|
* Adding merb:migrate recipe
|
data/Manifest.txt
CHANGED
@@ -6,11 +6,12 @@ README.txt
|
|
6
6
|
Rakefile
|
7
7
|
config/hoe.rb
|
8
8
|
config/requirements.rb
|
9
|
-
docs/nginx.README
|
10
9
|
lib/capitate.rb
|
11
10
|
lib/capitate/cap_ext/connections.rb
|
12
11
|
lib/capitate/cap_ext/docs.rb
|
12
|
+
lib/capitate/cap_ext/namespace.rb
|
13
13
|
lib/capitate/cap_ext/run_via.rb
|
14
|
+
lib/capitate/cap_ext/task_definition.rb
|
14
15
|
lib/capitate/cap_ext/variables.rb
|
15
16
|
lib/capitate/plugins/base.rb
|
16
17
|
lib/capitate/plugins/build.rb
|
@@ -78,6 +79,7 @@ lib/templates/logrotated/conf.erb
|
|
78
79
|
lib/templates/memcached/memcached.initd.centos.erb
|
79
80
|
lib/templates/memcached/memcached.monitrc.erb
|
80
81
|
lib/templates/memcached/memcached.yml.erb
|
82
|
+
lib/templates/merb/merb-no-http.monitrc.erb
|
81
83
|
lib/templates/merb/merb.initd.centos.erb
|
82
84
|
lib/templates/merb/merb.monitrc.erb
|
83
85
|
lib/templates/mongrel/mongrel_cluster.initd.centos.erb
|
@@ -112,11 +114,3 @@ test/test_helper.rb
|
|
112
114
|
test/test_plugin_upload.rb
|
113
115
|
test/test_recipes.rb
|
114
116
|
test/test_templates.rb
|
115
|
-
website/index.html
|
116
|
-
website/index.txt
|
117
|
-
website/javascripts/code_highlighter.js
|
118
|
-
website/javascripts/rounded_corners_lite.inc.js
|
119
|
-
website/javascripts/ruby.js
|
120
|
-
website/stylesheets/screen.css
|
121
|
-
website/template.rhtml
|
122
|
-
website/template_recipe.rhtml
|
data/lib/capitate.rb
CHANGED
@@ -27,6 +27,8 @@ require "capitate/cap_ext/connections"
|
|
27
27
|
require "capitate/cap_ext/variables"
|
28
28
|
require "capitate/cap_ext/run_via"
|
29
29
|
require "capitate/cap_ext/docs"
|
30
|
+
require "capitate/cap_ext/namespace"
|
31
|
+
require "capitate/cap_ext/task_definition"
|
30
32
|
|
31
33
|
class Capistrano::Configuration
|
32
34
|
include Capitate::CapExt::Variables
|
@@ -35,6 +37,18 @@ class Capistrano::Configuration
|
|
35
37
|
include Capitate::CapExt::Docs
|
36
38
|
end
|
37
39
|
|
40
|
+
class Capistrano::TaskDefinition
|
41
|
+
include Capitate::CapExt::TaskDefinition
|
42
|
+
end
|
43
|
+
|
44
|
+
class Capistrano::Configuration::Namespaces::Namespace
|
45
|
+
include Capitate::CapExt::Namespace
|
46
|
+
end
|
47
|
+
|
48
|
+
module Capistrano::Configuration::Namespaces
|
49
|
+
include Capitate::CapExt::Namespace
|
50
|
+
end
|
51
|
+
|
38
52
|
#module Capistrano::Configuration::Connections; end
|
39
53
|
|
40
54
|
require 'capitate/task_node'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Capitate
|
2
|
+
|
3
|
+
module CapExt
|
4
|
+
|
5
|
+
module Namespace
|
6
|
+
|
7
|
+
def self.included(base) #:nodoc:
|
8
|
+
unless base.method_defined?(:task_without_capitate)
|
9
|
+
base.send :alias_method, :task_without_capitate, :task
|
10
|
+
base.send :alias_method, :task, :task_with_capitate
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def task_arg(name, desc, options = {})
|
15
|
+
@next_task_arguments ||= []
|
16
|
+
@next_task_arguments << options.merge({ :name => name, :desc => desc })
|
17
|
+
end
|
18
|
+
|
19
|
+
def task_with_capitate(name, options={}, &block)
|
20
|
+
task_without_capitate(name, options) do
|
21
|
+
find_task(name).setup_defaults
|
22
|
+
block.call
|
23
|
+
end
|
24
|
+
task_def = find_task(name)
|
25
|
+
task_def.arguments = @next_task_arguments
|
26
|
+
@next_task_arguments = nil
|
27
|
+
task_def
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Capitate
|
2
|
+
|
3
|
+
module CapExt
|
4
|
+
|
5
|
+
module TaskDefinition
|
6
|
+
|
7
|
+
attr_accessor :arguments
|
8
|
+
|
9
|
+
def setup_defaults
|
10
|
+
return if arguments.blank?
|
11
|
+
|
12
|
+
arguments.each do |arg|
|
13
|
+
namespace.fetch_or_default(arg[:name], arg[:default]) if arg.has_key?(:default)
|
14
|
+
namespace.fetch_or_set(arg[:name], arg[:set]) if arg.has_key?(:set)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/capitate/task_node.rb
CHANGED
@@ -172,7 +172,27 @@ class Capitate::TaskNode
|
|
172
172
|
options = ""
|
173
173
|
options = "<span class='options'>, #{task.options.inspect}</span>" unless task.options.blank?
|
174
174
|
file.puts "h3(##{task.fully_qualified_name}). #{task.fully_qualified_name}#{options}\n\n"
|
175
|
-
file.puts "#{unindent(task.desc)}\n\n"
|
175
|
+
file.puts "#{unindent(task.desc)}\n\n"
|
176
|
+
if task.arguments
|
177
|
+
file.puts "h4. Parameters\n\n"
|
178
|
+
file.puts "<dl>\n"
|
179
|
+
task.arguments.each do |arg|
|
180
|
+
file.puts "<dt>#{arg[:name]}</dt>"
|
181
|
+
file.puts "<dd>#{unindent(arg[:desc])}</dd>" if arg.has_key?(:desc)
|
182
|
+
if arg.has_key?(:default_desc)
|
183
|
+
file.puts "<dd class='default'>Defaults to @#{arg[:default_desc]}@</dd>"
|
184
|
+
elsif arg.has_key?(:default)
|
185
|
+
file.puts "<dd class='default'>Defaults to @#{arg[:default].inspect}@</dd>"
|
186
|
+
end
|
187
|
+
|
188
|
+
if arg.has_key?(:set)
|
189
|
+
file.puts "<dd class='default'>Defaults to @#{arg[:set].inspect}@ (cap setting)</dd>"
|
190
|
+
end
|
191
|
+
|
192
|
+
file.puts "<dd class='example'>Example: @set :#{arg[:name]}, #{arg[:example]}@" if arg.has_key?(:example)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
file.puts "</dl>\n\n"
|
176
196
|
file.puts "</div>\n\n\n"
|
177
197
|
end
|
178
198
|
end
|
data/lib/capitate/version.rb
CHANGED
@@ -4,45 +4,16 @@ namespace :active_record do
|
|
4
4
|
Create (ActiveRecord) database yaml in shared path.
|
5
5
|
Note: If both @:db_host@ and @:db_socket@ are used, @db_socket@ wins.
|
6
6
|
|
7
|
-
<dl>
|
8
|
-
<dt>db_name</dt>
|
9
|
-
<dd>Database name.</dd>
|
10
|
-
<dd>@set :db_name, "app_db_name"@</dd>
|
11
|
-
|
12
|
-
<dt>db_user</dt>
|
13
|
-
<dd>Database user.</dd>
|
14
|
-
<dd>@set :db_user, "app_db_user"@</dd>
|
15
|
-
|
16
|
-
<dt>db_pass</dt>
|
17
|
-
<dd>Database password.</dd>
|
18
|
-
<dd>@set :db_pass, "the_password"@</dd>
|
19
|
-
|
20
|
-
<dt>db_host</dt>
|
21
|
-
<dd>Database host (can be nil, if you are using socket).</dd>
|
22
|
-
<dd class="default">Defaults to @nil@</dd>
|
23
|
-
|
24
|
-
<dt>db_socket</dt>
|
25
|
-
<dd>Database socket (can be nil, if you are using host).</dd>
|
26
|
-
<dd class="default">Defaults to @nil@</dd>
|
27
|
-
<dd>@set :db_socket, "/var/lib/mysql/mysql.sock"@</dd>
|
28
|
-
|
29
|
-
<dt>database_yml_template</dt>
|
30
|
-
<dd>Path to database yml erb template.
|
31
|
-
<dd class="default">Defaults to @rails/database.yml.erb@ (in this GEM)</dd>
|
32
|
-
</dl>
|
33
|
-
|
34
7
|
"Source":#{link_to_source(__FILE__)}
|
35
8
|
DESC
|
9
|
+
task_arg(:db_name, "Database name")
|
10
|
+
task_arg(:db_user, "Database user")
|
11
|
+
task_arg(:db_pass, "Database password")
|
12
|
+
task_arg(:db_host, "Database host", :default => nil)
|
13
|
+
task_arg(:db_socket, "Database socket", :default => nil)
|
14
|
+
task_arg(:database_yml_template, "Database yml template", :default => "rails/database.yml.erb")
|
36
15
|
task :setup, :roles => :app do
|
37
16
|
|
38
|
-
# Settings
|
39
|
-
fetch(:db_name)
|
40
|
-
fetch(:db_user)
|
41
|
-
fetch(:db_pass)
|
42
|
-
fetch_or_default(:db_host, nil)
|
43
|
-
fetch_or_default(:db_socket, nil)
|
44
|
-
fetch_or_default(:database_yml_template, "rails/database.yml.erb")
|
45
|
-
|
46
17
|
unless db_host.blank?
|
47
18
|
set :db_connect_type, "host"
|
48
19
|
set :db_connect, db_host
|
@@ -57,7 +28,7 @@ namespace :active_record do
|
|
57
28
|
put template.load(database_yml_template), "#{shared_path}/config/database.yml"
|
58
29
|
end
|
59
30
|
|
60
|
-
desc "Make symlink for database yaml"
|
31
|
+
desc "Make symlink for database yaml"
|
61
32
|
task :update_code do
|
62
33
|
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
63
34
|
end
|
data/lib/recipes/backgroundrb.rb
CHANGED
@@ -6,29 +6,14 @@ namespace :backgroundrb do
|
|
6
6
|
For pid path support, change backgroundrb script pid_file line to:
|
7
7
|
|
8
8
|
pid_file = "\#{CONFIG_FILE[:backgroundrb][:pid_file]}"
|
9
|
-
|
10
|
-
<dl>
|
11
|
-
<dt>backgroundrb_host</dt>
|
12
|
-
<dd>Backgroundrb host</dd>
|
13
|
-
<dd class="default">Defaults to @0.0.0.0@</dd>
|
14
9
|
|
15
|
-
<dt>backgroundrb_port</dt>
|
16
|
-
<dd>Backgroundrb port</dd>
|
17
|
-
<dd class="default">Defaults to @11006@</dd>
|
18
|
-
|
19
|
-
<dt>backgroundrb_yml_template</dt>
|
20
|
-
<dd>Backgroundrb yml template</dd>
|
21
|
-
<dd class="default">Defaults to @backgroundrb/backgroundrb.yml.erb@ in this gem.</dd>
|
22
|
-
</dl>
|
23
|
-
|
24
10
|
"Source":#{link_to_source(__FILE__)}
|
25
11
|
DESC
|
12
|
+
task_arg(:backgroundrb_host, "Backgroundrb host", :default => "0.0.0.0")
|
13
|
+
task_arg(:backgroundrb_port, "Backgroundrb port", :default => 11006)
|
14
|
+
task_arg(:backgroundrb_pid_path, "Backgroundrb pid path", :default => Proc.new{"#{shared_path}/pids/backgroundrb.pid"}, :default_desc => "\#{shared_path}/pids/backgroundrb.pid")
|
15
|
+
task_arg(:backgroundrb_yml_template, "Backgroundrb yml template", :default => "backgroundrb/backgroundrb.yml.erb")
|
26
16
|
task :setup do
|
27
|
-
fetch_or_default(:backgroundrb_host, "0.0.0.0")
|
28
|
-
fetch_or_default(:backgroundrb_port, 11006)
|
29
|
-
fetch_or_default(:backgroundrb_pid_path, "#{shared_path}/pids/backgroundrb.pid")
|
30
|
-
fetch_or_default(:backgroundrb_yml_template, "backgroundrb/backgroundrb.yml.erb")
|
31
|
-
|
32
17
|
utils.install_template(backgroundrb_yml_template, "#{shared_path}/config/backgroundrb.yml")
|
33
18
|
end
|
34
19
|
|
@@ -5,36 +5,15 @@ namespace :backgroundjob do
|
|
5
5
|
desc <<-DESC
|
6
6
|
Setup backgroundjob for application.
|
7
7
|
|
8
|
-
<dl>
|
9
|
-
<dt>backgroundjob_bin_path</dt>
|
10
|
-
<dd>Path to start.
|
11
|
-
<dd class="default">Defaults to:
|
12
|
-
<pre>
|
13
|
-
\#{current_path}/script/bj --forever --rails_env=production --rails_root=\#{current_path} --redirect \
|
14
|
-
--redirect=\#{backgroundjob_log_path} --pidfile=\#{backgroundjob_pid_path} &
|
15
|
-
</pre>
|
16
|
-
</dd>
|
17
|
-
<dt>backgroundjob_pid_path</dt>
|
18
|
-
<dd>Path to backgroundjob pid file</dd>
|
19
|
-
<dd class="default">Defaults to @\#{shared_path}/pids/bj.pid@</dd>
|
20
|
-
|
21
|
-
<dt>backgroundjob_log_path</dt>
|
22
|
-
<dd>Path to backgroundjob log file</dd>
|
23
|
-
<dd class="default">Defaults to @\#{shared_path}/logs/bj.log@</dd>
|
24
|
-
</dl>
|
25
8
|
"Source":#{link_to_source(__FILE__)}
|
26
9
|
DESC
|
10
|
+
task_arg(:backgroundjob_bin_path, "Path to backgroundjob",
|
11
|
+
:default => Proc.new{"#{current_path}/script/bj run --forever --rails_env=production --rails_root=#{current_path} --redirect=#{backgroundjob_log_path} --log=#{backgroundjob_log_path} --pidfile=#{backgroundjob_pid_path} --daemon"},
|
12
|
+
:default_desc => "\#{current_path}/script/bj run --forever --rails_env=production --rails_root=\#{current_path} --redirect=\#{backgroundjob_log_path} --log=\#{backgroundjob_log_path} --pidfile=\#{backgroundjob_pid_path} --daemon")
|
13
|
+
task_arg(:backgroundjob_pid_path, "Path to backgroundjob pid file", :default => Proc.new{"#{shared_path}/pids/bj.pid"}, :default_desc => "\#{shared_path}/pids/bj.pid")
|
14
|
+
task_arg(:backgroundjob_log_path, "Path to backgroundjob log file", :default => Proc.new{"#{shared_path}/log/bj.log"}, :default_desc => "\#{shared_path}/log/bj.log")
|
27
15
|
task :setup do
|
28
|
-
# Settings
|
29
|
-
fetch_or_default(:backgroundjob_pid_path, "#{shared_path}/pids/bj.pid")
|
30
|
-
fetch_or_default(:backgroundjob_log_path, "#{shared_path}/log/bj.log")
|
31
|
-
|
32
|
-
default_bin_path = "#{current_path}/script/bj run --forever --rails_env=production --rails_root=#{current_path} \
|
33
|
-
--redirect=#{backgroundjob_log_path} --pidfile=#{backgroundjob_pid_path} &"
|
34
16
|
|
35
|
-
fetch_or_default(:backgroundjob_bin_path, default_bin_path)
|
36
|
-
|
37
|
-
|
38
17
|
# Install initscript
|
39
18
|
utils.install_template("backgroundjob/backgroundjob.initd.centos.erb", "/etc/init.d/backgroundjob_#{application}")
|
40
19
|
|
@@ -5,22 +5,11 @@ namespace :backgroundrb do
|
|
5
5
|
desc <<-DESC
|
6
6
|
Setup backgroundrb for application.
|
7
7
|
|
8
|
-
<dl>
|
9
|
-
<dt>backgroundrb_bin_path</dt>
|
10
|
-
<dd>Path to start.
|
11
|
-
<dd class="default">Defaults to @\#{current_path}/script/backgroundrb -e production start@</dd>
|
12
|
-
<dt>backgroundrb_pid_path</dt>
|
13
|
-
<dd>Path to backgroundrb pid file</dd>
|
14
|
-
<dd class="default">Defaults to @\#{shared_path}/pids/backgroundrb.pid@</dd>
|
15
|
-
</dl>
|
16
8
|
"Source":#{link_to_source(__FILE__)}
|
17
9
|
DESC
|
10
|
+
task_arg(:backgroundrb_bin_path, "Path to backgroundrb bin", :default => Proc.new{"#{current_path}/script/backgroundrb -e production start"}, :default_desc => "\#{current_path}/script/backgroundrb -e production start")
|
11
|
+
task_arg(:backgroundrb_pid_path, "Path to backgroundrb pid file", :default => Proc.new{"#{shared_path}/pids/backgroundrb.pid"}, :default_desc => "\#{shared_path}/pids/backgroundrb.pid")
|
18
12
|
task :setup do
|
19
|
-
|
20
|
-
# Settings
|
21
|
-
fetch_or_default(:backgroundrb_bin_path, "#{current_path}/script/backgroundrb -e production start")
|
22
|
-
fetch_or_default(:backgroundrb_pid_path, "#{shared_path}/pids/backgroundrb.pid")
|
23
|
-
|
24
13
|
# Install initscript
|
25
14
|
utils.install_template("backgroundrb/backgroundrb.initd.centos.erb", "/etc/init.d/backgroundrb_#{application}")
|
26
15
|
|
@@ -5,36 +5,14 @@ namespace :centos do
|
|
5
5
|
desc <<-DESC
|
6
6
|
Add user and set user password for application. Adds user to specified groups.
|
7
7
|
|
8
|
-
<dl>
|
9
|
-
<dt>user_add</dt>
|
10
|
-
<dd>User to add.</dd>
|
11
|
-
<dd>@set :user_add, "app_user"@</dd>
|
12
|
-
|
13
|
-
<dt>groups</dt>
|
14
|
-
<dd>Groups for user to be in.</dd>
|
15
|
-
<dd class="default">Defaults to @nil@</dd>
|
16
|
-
<dd>@set :groups, "admin,foo"@</dd>
|
17
|
-
|
18
|
-
<dt>home</dt>
|
19
|
-
<dd>Home directory for user.</dd>
|
20
|
-
<dd class="default">Defaults to @:deploy_to@ setting_</dd>
|
21
|
-
<dd>@set :home, "/var/www/apps/app_name"@</dd>
|
22
|
-
|
23
|
-
<dt>home_readable</dt>
|
24
|
-
<dd>Whether home permissions are readable by all. Needed if using deploy dir as home.</dd>
|
25
|
-
<dd class="default">Defaults to @true@</dd>
|
26
|
-
<dd>@set :home_readable, true@</dd>
|
27
|
-
</dl>
|
28
8
|
"Source":#{link_to_source(__FILE__)}
|
29
9
|
DESC
|
10
|
+
task_arg(:user_add, "User to add")
|
11
|
+
task_arg(:groups, "Groups for user to be in", :default => nil, :example => "\"admin,foo,bar\"")
|
12
|
+
task_arg(:home, "Home directory for user", :set => :deploy_to)
|
13
|
+
task_arg(:home_readable, "Whether home permissions are readable by all. Needed if using deploy dir as home.", :default => true)
|
30
14
|
task :add_user do
|
31
15
|
|
32
|
-
# Settings
|
33
|
-
fetch(:user_add)
|
34
|
-
fetch_or_default(:groups, nil)
|
35
|
-
fetch_or_default(:home, deploy_to)
|
36
|
-
fetch_or_default(:home_readable, true)
|
37
|
-
|
38
16
|
adduser_options = []
|
39
17
|
adduser_options << "-d #{home}" unless home.blank?
|
40
18
|
adduser_options << "-G #{groups}" unless groups.blank?
|
@@ -2,8 +2,12 @@ namespace :imagemagick do
|
|
2
2
|
namespace :centos do
|
3
3
|
|
4
4
|
desc <<-DESC
|
5
|
-
Install imagemagick
|
6
|
-
|
5
|
+
Install imagemagick.
|
6
|
+
|
7
|
+
"Source":#{link_to_source(__FILE__)}
|
8
|
+
DESC
|
9
|
+
task_arg(:imagemagick_build_options, <<-EOS)
|
10
|
+
Imagemagick build options
|
7
11
|
<pre>
|
8
12
|
<code class="ruby">
|
9
13
|
set :imagemagick_build_options, {
|
@@ -12,13 +16,8 @@ namespace :imagemagick do
|
|
12
16
|
}
|
13
17
|
</code>
|
14
18
|
</pre>
|
15
|
-
|
16
|
-
|
17
|
-
task :install do
|
18
|
-
|
19
|
-
# Settings
|
20
|
-
fetch(:imagemagick_build_options)
|
21
|
-
|
19
|
+
EOS
|
20
|
+
task :install do
|
22
21
|
# Install dependencies
|
23
22
|
yum.install([ "libjpeg-devel", "libpng-devel", "glib2-devel", "fontconfig-devel", "zlib-devel",
|
24
23
|
"libwmf-devel", "freetype-devel", "libtiff-devel" ])
|
@@ -5,10 +5,13 @@ namespace :memcached do
|
|
5
5
|
desc <<-DESC
|
6
6
|
Install memcached.
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
"Source":#{link_to_source(__FILE__)}
|
9
|
+
DESC
|
10
|
+
task_arg(:memcached_pid_path, "Path to memcached pid file.", :default => "/var/run/memcached.pid")
|
11
|
+
task_arg(:memcached_port, "Memcached port", :default => 11211)
|
12
|
+
task_arg(:memcached_memory, "Memcached memory (in MB)")
|
13
|
+
task_arg(:memcached_build_options, <<-EOS)
|
14
|
+
Memcached build options
|
12
15
|
<pre>
|
13
16
|
<code class="ruby">
|
14
17
|
set :memcached_build_options, {
|
@@ -17,66 +20,22 @@ namespace :memcached do
|
|
17
20
|
}
|
18
21
|
</code>
|
19
22
|
</pre>
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<dt>memcached_memory</dt>
|
24
|
-
<dd>Memcached memory (in MB).</dd>
|
25
|
-
<dd>@set :memcached_memory, 64@</dd>
|
26
|
-
|
27
|
-
<dt>memcached_pid_path*</dt>
|
28
|
-
<dd>Path to memcached pid file.</dd>
|
29
|
-
<dd class="default">Defaults to @/var/run/memcached.pid@</dd>
|
30
|
-
<dd>@set :memcached_pid_path, "/var/run/memcached.pid"@</dd>
|
31
|
-
|
32
|
-
<dt>memcached_port</dt>
|
33
|
-
<dd>Memcached port<dd>
|
34
|
-
<dd class="default">Defaults to 11211.</dd>
|
35
|
-
<dd>@set :memcached_port, 11211@</dd>
|
36
|
-
|
37
|
-
</dl>
|
38
|
-
"Source":#{link_to_source(__FILE__)}
|
39
|
-
DESC
|
23
|
+
EOS
|
40
24
|
task :install do
|
41
|
-
|
42
|
-
# Settings
|
43
|
-
fetch_or_default(:memcached_pid_path, "/var/run/memcached.pid")
|
44
|
-
fetch_or_default(:memcached_port, 11211)
|
45
|
-
fetch(:memcached_memory)
|
46
|
-
fetch(:memcached_build_options)
|
47
|
-
|
48
25
|
# Build
|
49
26
|
build.make_install("memcached", memcached_build_options)
|
50
|
-
|
51
27
|
initscript
|
52
28
|
end
|
53
29
|
|
54
30
|
desc <<-DESC
|
55
31
|
Install memcached initscript.
|
56
32
|
|
57
|
-
<dl>
|
58
|
-
<dt>memcached_memory</dt>
|
59
|
-
<dd>Memcached memory (in MB).</dd>
|
60
|
-
<dd>@set :memcached_memory, 64@</dd>
|
61
|
-
|
62
|
-
<dt>memcached_pid_path*</dt>
|
63
|
-
<dd>Path to memcached pid file.</dd>
|
64
|
-
<dd class="default">Defaults to @/var/run/memcached.pid@</dd>
|
65
|
-
<dd>@set :memcached_pid_path, "/var/run/memcached.pid"@</dd>
|
66
|
-
|
67
|
-
<dt>memcached_port</dt>
|
68
|
-
<dd>Memcached port<dd>
|
69
|
-
<dd class="default">Defaults to 11211.</dd>
|
70
|
-
<dd>@set :memcached_port, 11211@</dd>
|
71
|
-
</dl>
|
72
33
|
"Source":#{link_to_source(__FILE__)}
|
73
34
|
DESC
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
fetch(:memcached_memory)
|
79
|
-
|
35
|
+
task_arg(:memcached_pid_path, "Path to memcached pid file.", :default => "/var/run/memcached.pid")
|
36
|
+
task_arg(:memcached_port, "Memcached port", :default => 11211)
|
37
|
+
task_arg(:memcached_memory, "Memcached memory (in MB)")
|
38
|
+
task :initscript do
|
80
39
|
utils.install_template("memcached/memcached.initd.centos.erb", "/etc/init.d/memcached")
|
81
40
|
run_via "/sbin/chkconfig --level 345 memcached on"
|
82
41
|
end
|