capitate 0.2.14 → 0.2.15

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 CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2.15 2008-03-31
2
+
3
+ * Adding backgroundjob recipes and templates.
4
+ * Fixed backgroundrb monit host port check (removed)
5
+
1
6
  == 0.2.14 2008-03-27
2
7
 
3
8
  * Removing my lame monkey patches
data/Manifest.txt CHANGED
@@ -27,6 +27,7 @@ lib/capitate/task_node.rb
27
27
  lib/capitate/version.rb
28
28
  lib/deployment/centos-5.1-64-web/install.rb
29
29
  lib/recipes/backgroundrb.rb
30
+ lib/recipes/centos/backgroundjob.rb
30
31
  lib/recipes/centos/backgroundrb.rb
31
32
  lib/recipes/centos/centos.rb
32
33
  lib/recipes/centos/imagemagick.rb
@@ -38,6 +39,7 @@ lib/recipes/centos/nginx.rb
38
39
  lib/recipes/centos/ruby.rb
39
40
  lib/recipes/centos/sphinx.rb
40
41
  lib/recipes/docs.rb
42
+ lib/recipes/logrotate/backgroundjob.rb
41
43
  lib/recipes/logrotate/backgroundrb.rb
42
44
  lib/recipes/logrotate/mongrel_cluster.rb
43
45
  lib/recipes/logrotate/monit.rb
@@ -48,6 +50,7 @@ lib/recipes/logrotate/sphinx.rb
48
50
  lib/recipes/logrotated.rb
49
51
  lib/recipes/memcached.rb
50
52
  lib/recipes/monit.rb
53
+ lib/recipes/monit/backgroundjob.rb
51
54
  lib/recipes/monit/backgroundrb.rb
52
55
  lib/recipes/monit/database.rb
53
56
  lib/recipes/monit/memcached.rb
@@ -62,6 +65,8 @@ lib/recipes/rails.rb
62
65
  lib/recipes/sphinx.rb
63
66
  lib/recipes/sshd.rb
64
67
  lib/recipes/syslogd.rb
68
+ lib/templates/backgroundjob/backgroundjob.initd.centos.erb
69
+ lib/templates/backgroundjob/backgroundjob.monitrc.erb
65
70
  lib/templates/backgroundrb/backgroundrb.initd.centos.erb
66
71
  lib/templates/backgroundrb/backgroundrb.monitrc.erb
67
72
  lib/templates/backgroundrb/backgroundrb.yml.erb
@@ -127,9 +127,17 @@ class Capitate::TaskNode
127
127
  names.pop
128
128
  end
129
129
  end
130
+
130
131
  # Write breadcrumb
131
132
  file.puts %{ "home":../index.html > "recipes":index.html > #{links.reverse.join(" > ")} }
132
133
 
134
+ # Write task count
135
+ # count = 0
136
+ # each_node do |snode, level|
137
+ # count += snode.tasks.length
138
+ # end
139
+ # file.puts %{\n\n*#{count}* tasks!\n\n}
140
+
133
141
  #
134
142
  # Namespace
135
143
  #
@@ -137,8 +145,9 @@ class Capitate::TaskNode
137
145
  file.puts "\n\nh2. Namespaces\n\n"
138
146
  each_node do |snode, level|
139
147
  #li_level = (0..level).collect { "*" }.join
148
+ li_level = "*"
140
149
  if snode.tasks.length > 0
141
- file.puts %{* "#{snode.full_name(":")}":#{snode.full_name}.html (#{snode.tasks.length}) \n}
150
+ file.puts %{#{li_level} "#{snode.full_name(":")}":#{snode.full_name}.html (#{snode.tasks.length}) \n}
142
151
  end
143
152
  end
144
153
  end
@@ -2,7 +2,7 @@ module Capitate #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 14
5
+ TINY = 15
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,51 @@
1
+ namespace :backgroundjob do
2
+
3
+ namespace :centos do
4
+
5
+ desc <<-DESC
6
+ Setup backgroundjob for application.
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
+ "Source":#{link_to_source(__FILE__)}
26
+ DESC
27
+ task :setup do
28
+
29
+
30
+
31
+ # Settings
32
+ fetch_or_default(:backgroundjob_pid_path, "#{shared_path}/pids/bj.pid")
33
+ fetch_or_default(:backgroundjob_log_path, "#{shared_path}/log/bj.log")
34
+
35
+ default_bin_path = "#{current_path}/script/bj run --forever --rails_env=production --rails_root=#{current_path} \
36
+ --redirect=#{backgroundjob_log_path} --pidfile=#{backgroundjob_pid_path} &"
37
+
38
+ fetch_or_default(:backgroundjob_bin_path, default_bin_path)
39
+
40
+
41
+ # Install initscript
42
+ utils.install_template("backgroundjob/backgroundjob.initd.centos.erb", "/etc/init.d/backgroundjob_#{application}")
43
+
44
+ # Enable service
45
+ run_via "/sbin/chkconfig --level 345 backgroundjob_#{application} on"
46
+
47
+ end
48
+
49
+ end
50
+
51
+ end
@@ -0,0 +1,26 @@
1
+ namespace :backgroundjob do
2
+
3
+ namespace :logrotate do
4
+
5
+ desc <<-DESC
6
+ Install logrotated conf for backgroundjob.
7
+
8
+ <dl>
9
+ <dt>backgroundjob_logrotate_path<dt>
10
+ <dd>Backgroundjob logrotate paths.</dd>
11
+ <dd class="default">Defaults to @\#{shared_path}/log/bj*.log@</dd>
12
+ </dl>
13
+ "Source":#{link_to_source(__FILE__)}
14
+ DESC
15
+ task :install do
16
+ fetch_or_default(:backgroundjob_logrotate_path, "#{shared_path}/log/bj*.log")
17
+
18
+ set :logrotate_name, "backgroundjob_#{application}"
19
+ set :logrotate_log_path, backgroundjob_logrotate_path
20
+ set :logrotate_options, [ { :rotate => 2 }, :weekly, :missingok, :notifempty, :copytruncate ]
21
+
22
+ logrotated.install_conf
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,38 @@
1
+ namespace :backgroundjob do
2
+
3
+ namespace :monit do
4
+
5
+ desc <<-DESC
6
+ Generate and install backgroundjob (for application) monitrc.
7
+
8
+ "Source":#{link_to_source(__FILE__)}
9
+ DESC
10
+ task :install do
11
+
12
+ # Settings
13
+ fetch_or_default(:backgroundjob_pid_path, "#{shared_path}/pids/bj.pid")
14
+ fetch_or_default(:monit_conf_dir, "/etc/monit")
15
+
16
+ utils.install_template("backgroundjob/backgroundjob.monitrc.erb", "#{monit_conf_dir}/backgroundjob.monitrc")
17
+ end
18
+
19
+ desc "Restart backgroundrb (for application)"
20
+ task :restart do
21
+ fetch_or_default(:monit_bin_path, "monit")
22
+ sudo "#{monit_bin_path} restart backgroundjob_#{application}"
23
+ end
24
+
25
+ desc "Start backgroundrb (for application)"
26
+ task :start do
27
+ fetch_or_default(:monit_bin_path, "monit")
28
+ sudo "#{monit_bin_path} start backgroundjob_#{application}"
29
+ end
30
+
31
+ desc "Stop backgroundrb (for application)"
32
+ task :stop do
33
+ fetch_or_default(:monit_bin_path, "monit")
34
+ sudo "#{monit_bin_path} stop backgroundjob_#{application}"
35
+ end
36
+ end
37
+
38
+ end
@@ -10,7 +10,6 @@ namespace :backgroundrb do
10
10
  task :install do
11
11
 
12
12
  # Settings
13
- fetch_or_default(:backgroundrb_port, 11006)
14
13
  fetch_or_default(:backgroundrb_pid_path, "#{shared_path}/pids/backgroundrb.pid")
15
14
  fetch_or_default(:monit_conf_dir, "/etc/monit")
16
15
 
@@ -0,0 +1,55 @@
1
+ #! /bin/sh
2
+ # backgroundjob_<%= application %>: Backgroundjob daemon for <%= application %>
3
+ #
4
+ # chkconfig: - 86 14
5
+ # description: backgroundjob daemon
6
+ # processname: bj
7
+ #
8
+ # Author: Gabriel Handford http://ducktyper.com
9
+
10
+ # Source function library
11
+ . /etc/rc.d/init.d/functions
12
+
13
+ RETVAL=0
14
+
15
+ DESC="backgroundjob daemon (<%= application %>)"
16
+ DAEMON="<%= backgroundjob_bin_path %>"
17
+ PIDFILE="<%= backgroundjob_pid_path %>"
18
+
19
+ start() {
20
+ daemon --user <%= user %> --pidfile $PIDFILE $DAEMON
21
+ RETVAL=$?
22
+ echo
23
+ return $RETVAL;
24
+ }
25
+
26
+ stop() {
27
+ kill -TERM `cat $PIDFILE` || echo -n " not running"
28
+ }
29
+
30
+ case "$1" in
31
+ start)
32
+ echo -n "Starting $DESC: $NAME"
33
+ start
34
+ RETVAL=$?;
35
+ ;;
36
+ stop)
37
+ echo -n "Stopping $DESC: $NAME"
38
+ stop
39
+ RETVAL=$?;
40
+ ;;
41
+ restart)
42
+ echo -n "Restarting $DESC: $NAME"
43
+ stop
44
+ # Sleep after stop
45
+ sleep 1
46
+ start
47
+ RETVAL=$?;
48
+ ;;
49
+ *)
50
+ echo "Usage: $0 {start|stop|restart}" >&2
51
+ RETVAL=3;
52
+ ;;
53
+ esac
54
+
55
+ exit $RETVAL;
@@ -0,0 +1,3 @@
1
+ check process backgroundjob_<%= application %> with pidfile <%= backgroundjob_pid_path %>
2
+ start program = "/sbin/service backgroundjob_<%= application %> start"
3
+ stop program = "/sbin/service backgroundjob_<%= application %> stop"
@@ -1,4 +1,3 @@
1
1
  check process backgroundrb_<%= application %> with pidfile <%= backgroundrb_pid_path %>
2
2
  start program = "/sbin/service backgroundrb_<%= application %> start"
3
3
  stop program = "/sbin/service backgroundrb_<%= application %> stop"
4
- if failed host 127.0.0.1 port <%= backgroundrb_port %> then restart
@@ -20,7 +20,7 @@
20
20
  [client]
21
21
  port = <%= db_port %>
22
22
  socket = <%= db_socket %>
23
- max_allowed_packet = 32M
23
+ #max_allowed_packet = 32M
24
24
 
25
25
  [mysqld]
26
26
  ######### engine and access interfaces
data/website/index.html CHANGED
@@ -8,9 +8,6 @@
8
8
  &#x2192; &#8216;capitate&#8217;: Capistrano recipes, plugins and templates.
9
9
  </title>
10
10
  <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
- <style>
12
-
13
- </style>
14
11
  <script type="text/javascript">
15
12
  window.onload = function() {
16
13
  settings = {
@@ -38,7 +35,7 @@
38
35
 
39
36
  <div id="version" class="clickable box" onclick='document.location = "http://rubyforge.org/projects/capitate"; return false'>
40
37
  <p>Get Version</p>
41
- <a href="http://rubyforge.org/projects/capitate" class="numbers">0.2.14</a>
38
+ <a href="http://rubyforge.org/projects/capitate" class="numbers">0.2.15</a>
42
39
  </div>
43
40
 
44
41
  <div id="recipes">
@@ -138,7 +135,7 @@
138
135
  <p>Comments are welcome. Send an email to <a href="mailto:gabrielh@gmail.com">Gabriel Handford</a> via the <a href="http://groups.google.com/group/capitate">forum</a></p>
139
136
  </div>
140
137
  <p class="coda">
141
- <a href="mailto:gabrielh@gmail.com">Gabriel Handford</a>, 13th March 2008<br>
138
+ <a href="http://ducktyper.com">ducktyper.com</a>, 13th March 2008<br>
142
139
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
143
140
  </p>
144
141
  </div>
@@ -8,9 +8,6 @@
8
8
  <%= title %>: Capistrano recipes, plugins and templates.
9
9
  </title>
10
10
  <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
- <style>
12
-
13
- </style>
14
11
  <script type="text/javascript">
15
12
  window.onload = function() {
16
13
  settings = {
@@ -53,7 +50,7 @@
53
50
  <%= body %>
54
51
  </div>
55
52
  <p class="coda">
56
- <a href="mailto:gabrielh@gmail.com">Gabriel Handford</a>, <%= modified.pretty %><br>
53
+ <a href="http://ducktyper.com">ducktyper.com</a>, <%= modified.pretty %><br>
57
54
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
58
55
  </p>
59
56
  </div>
@@ -18,9 +18,13 @@
18
18
  <div id="main" class="recipes">
19
19
 
20
20
  <h1><%= title %></h1>
21
+
22
+ <div>
21
23
  <%= body %>
24
+ </div>
25
+
22
26
  <p class="coda">
23
- <a href="mailto:gabrielh@gmail.com">Gabriel Handford</a>, <%= modified.pretty %><br>
27
+ <a href="http://ducktyper.com">ducktyper.com</a>, <%= modified.pretty %><br>
24
28
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
25
29
  </p>
26
30
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capitate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  platform: ""
6
6
  authors:
7
7
  - Gabriel Handford
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-27 00:00:00 -04:00
12
+ date: 2008-03-31 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -64,6 +64,7 @@ files:
64
64
  - lib/capitate/version.rb
65
65
  - lib/deployment/centos-5.1-64-web/install.rb
66
66
  - lib/recipes/backgroundrb.rb
67
+ - lib/recipes/centos/backgroundjob.rb
67
68
  - lib/recipes/centos/backgroundrb.rb
68
69
  - lib/recipes/centos/centos.rb
69
70
  - lib/recipes/centos/imagemagick.rb
@@ -75,6 +76,7 @@ files:
75
76
  - lib/recipes/centos/ruby.rb
76
77
  - lib/recipes/centos/sphinx.rb
77
78
  - lib/recipes/docs.rb
79
+ - lib/recipes/logrotate/backgroundjob.rb
78
80
  - lib/recipes/logrotate/backgroundrb.rb
79
81
  - lib/recipes/logrotate/mongrel_cluster.rb
80
82
  - lib/recipes/logrotate/monit.rb
@@ -85,6 +87,7 @@ files:
85
87
  - lib/recipes/logrotated.rb
86
88
  - lib/recipes/memcached.rb
87
89
  - lib/recipes/monit.rb
90
+ - lib/recipes/monit/backgroundjob.rb
88
91
  - lib/recipes/monit/backgroundrb.rb
89
92
  - lib/recipes/monit/database.rb
90
93
  - lib/recipes/monit/memcached.rb
@@ -99,6 +102,8 @@ files:
99
102
  - lib/recipes/sphinx.rb
100
103
  - lib/recipes/sshd.rb
101
104
  - lib/recipes/syslogd.rb
105
+ - lib/templates/backgroundjob/backgroundjob.initd.centos.erb
106
+ - lib/templates/backgroundjob/backgroundjob.monitrc.erb
102
107
  - lib/templates/backgroundrb/backgroundrb.initd.centos.erb
103
108
  - lib/templates/backgroundrb/backgroundrb.monitrc.erb
104
109
  - lib/templates/backgroundrb/backgroundrb.yml.erb