capitate 0.3.4 → 0.3.5

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,10 @@
1
+ == 0.3.5 2008-05-08
2
+
3
+ * Adding merb:migrate recipe
4
+ * Fixing merb monitrc
5
+ * Added preview variables prompt
6
+ * Fixed merb logrotate defaults
7
+
1
8
  == 0.3.4 2008-05-05
2
9
 
3
10
  * Removed upload plugin (obsolete)
data/Manifest.txt CHANGED
@@ -4,7 +4,6 @@ License.txt
4
4
  Manifest.txt
5
5
  README.txt
6
6
  Rakefile
7
- bin/capitate
8
7
  config/hoe.rb
9
8
  config/requirements.rb
10
9
  docs/nginx.README
@@ -51,6 +50,7 @@ lib/recipes/logrotate/rails.rb
51
50
  lib/recipes/logrotate/sphinx.rb
52
51
  lib/recipes/logrotated.rb
53
52
  lib/recipes/memcached.rb
53
+ lib/recipes/merb.rb
54
54
  lib/recipes/monit.rb
55
55
  lib/recipes/monit/backgroundjob.rb
56
56
  lib/recipes/monit/backgroundrb.rb
@@ -5,8 +5,8 @@ module Capitate::Plugins::Prompt
5
5
  # Prompt.
6
6
  #
7
7
  # ==== Options
8
- # +label+:: Label
9
- # +options+:: Options (none yet)
8
+ # :label<String>:: Label
9
+ # :options<Hash>:: An options hash (see below)
10
10
  #
11
11
  def ask(label, options = {}, &block)
12
12
  Capistrano::CLI.ui.ask(label, &block)
@@ -14,15 +14,15 @@ module Capitate::Plugins::Prompt
14
14
 
15
15
  # Prompt for password.
16
16
  #
17
- # ==== Options
18
- # +label+:: Label
19
- # +options+:: Options (see Password options)
17
+ # ==== Options (options)
18
+ # :label<String>:: Label
19
+ # :options<Hash>:: An options hash (see below)
20
20
  #
21
21
  # ==== Password options
22
- # +verify+:: If true, prompt twice and verify
23
- # +lazy+:: If true, returns a Proc. _Defaults to true_
24
- # +check_hash+:: If present, checks that md5 is same as password md5
25
- # +max_attempts+:: Number of attempts to retry. _Defaults to 3_
22
+ # :verify<bool>:: If true, prompt twice and verify
23
+ # :lazy<bool>:: If true, returns a Proc. _Defaults to true_
24
+ # :check_hash<String>:: If present, checks that md5 is same as password md5
25
+ # :max_attempts<Integer>:: Number of attempts to retry. _Defaults to 3_
26
26
  #
27
27
  def password(label, options = {})
28
28
 
@@ -73,6 +73,37 @@ module Capitate::Plugins::Prompt
73
73
  password_prompt.call
74
74
  end
75
75
 
76
+ # Preview variables, and re-set them if asked to.
77
+ # Uses highline menus. Is not very intelligent.
78
+ #
79
+ # ==== Options
80
+ # :variables<Array>:: List of variables to show and verify
81
+ # :header<String>:: Menu header
82
+ # :prompt<String>:: Menu prompt
83
+ #
84
+ def preview_variables(variables, header = "Verify your settings", prompt = "Choose: ")
85
+ hl = Capistrano::CLI.ui
86
+
87
+ confirmed = false
88
+ while not confirmed do
89
+ hl.choose do |menu|
90
+ menu.header = header
91
+ menu.prompt = prompt
92
+
93
+ menu.choice("<Continue>") do
94
+ confirmed = true
95
+ end
96
+
97
+ variables.each do |variable|
98
+ menu.choice("#{variable}: #{fetch(variable)}") do
99
+ new_setting = ask("Set #{variable}: ") { |q| q.default = fetch(variable) }
100
+ set variable, new_setting
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
106
+
76
107
  end
77
108
 
78
109
  Capistrano.plugin :prompt, Capitate::Plugins::Prompt
@@ -2,7 +2,7 @@ module Capitate #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -7,12 +7,12 @@ namespace :merb do
7
7
  <dl>
8
8
  <dt>merb_logrotate_path</dt>
9
9
  <dd>Merb logrotate path</dd>
10
- <dd class="default">Defaults to @\#{shared_path}/log/merb_*.log@</dd>
10
+ <dd class="default">Defaults to @\#{shared_path}/log/merb.*.log@</dd>
11
11
  </dl>
12
12
  "Source":#{link_to_source(__FILE__)}
13
13
  DESC
14
14
  task :install do
15
- fetch_or_default(:merb_logrotate_path, "#{shared_path}/log/merb_*.log")
15
+ fetch_or_default(:merb_logrotate_path, "#{shared_path}/log/merb.*.log")
16
16
 
17
17
  set :logrotate_name, "merb_#{application}"
18
18
  set :logrotate_log_path, merb_logrotate_path
@@ -0,0 +1,33 @@
1
+ namespace :merb do
2
+
3
+ desc <<-DESC
4
+ Run the migrate rake task. By default, it runs this in most recently \
5
+ deployed version of the app. However, you can specify a different release \
6
+ via the migrate_target variable, which must be one of :latest (for the \
7
+ default behavior), or :current (for the release indicated by the \
8
+ `current' symlink). Strings will work for those values instead of symbols, \
9
+ too. You can also specify additional environment variables to pass to rake \
10
+ via the migrate_env variable. Finally, you can specify the full path to the \
11
+ rake executable by setting the rake variable. The defaults are:
12
+
13
+ set :rake, "rake"
14
+ set :merb_env, "production"
15
+ set :migrate_env, ""
16
+ set :migrate_target, :latest
17
+ DESC
18
+ task :migrate, :roles => :db, :only => { :primary => true } do
19
+ rake = fetch(:rake, "rake")
20
+ merb_env = fetch(:merb_env, "production")
21
+ migrate_env = fetch(:migrate_env, "")
22
+ migrate_target = fetch(:migrate_target, :latest)
23
+
24
+ current_directory = case migrate_target.to_sym
25
+ when :current then current_path
26
+ when :latest then current_release
27
+ else raise ArgumentError, "unknown migration target #{migrate_target.inspect}"
28
+ end
29
+
30
+ run "cd #{current_directory}; #{rake} MERB_ENV=#{merb_env} #{migrate_env} db:migrate"
31
+ end
32
+
33
+ end
@@ -1,7 +1,7 @@
1
1
 
2
2
  namespace :merb do
3
3
 
4
- namespace :monit do
4
+ namespace :monit do
5
5
 
6
6
  desc <<-DESC
7
7
  Create monit configuration for merb.
@@ -23,7 +23,7 @@ namespace :merb do
23
23
  ports = (0...merb_nodes).collect { |i| merb_port + i }
24
24
  ports.each do |port|
25
25
 
26
- pid_path = "#{merb_pid_dir}/#{merb_application}.#{port}.pid"
26
+ pid_path = "#{merb_pid_dir}/merb.#{port}.pid"
27
27
 
28
28
  start = "/etc/init.d/#{merb_initscript_name} start_only #{port}"
29
29
  stop = "/etc/init.d/#{merb_initscript_name} stop_only #{port}"
data/website/index.html CHANGED
@@ -35,7 +35,7 @@
35
35
 
36
36
  <div id="version" class="clickable box" onclick='document.location = "http://rubyforge.org/projects/capitate"; return false'>
37
37
  <p>Get Version</p>
38
- <a href="http://rubyforge.org/projects/capitate" class="numbers">0.3.4</a>
38
+ <a href="http://rubyforge.org/projects/capitate" class="numbers">0.3.5</a>
39
39
  </div>
40
40
 
41
41
  <div id="recipes">
@@ -77,7 +77,7 @@
77
77
 
78
78
 
79
79
  <ul>
80
- <li>Plugins to help install applications, via yum or manually unpacking, and building. Also to help upload files sanely, prompt for input, install gems, run shell scripts, etc.</li>
80
+ <li>Plugins to help install applications, via yum or manually unpacking, and building. Also to prompt for input, install gems, run shell scripts, etc.</li>
81
81
  <li>Templates for init scripts and application configuration</li>
82
82
  <li>Templates and recipes for common apps like monit, nginx, sphinx, mongrel, ruby and mysql</li>
83
83
  <li>Common deployment setup and update_code tasks, such as symlinking in database.yml and more advanced recipes such as sphinx configuration.</li>
@@ -135,7 +135,7 @@
135
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>
136
136
  </div>
137
137
  <p class="coda">
138
- <a href="http://ducktyper.com">ducktyper.com</a>, 13th March 2008<br>
138
+ <a href="http://ducktyper.com">ducktyper.com</a>, 8th May 2008<br>
139
139
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
140
140
  </p>
141
141
  </div>
data/website/index.txt CHANGED
@@ -23,7 +23,7 @@ h2. The basics
23
23
 
24
24
  Capitate has:
25
25
 
26
- * Plugins to help install applications, via yum or manually unpacking, and building. Also to help upload files sanely, prompt for input, install gems, run shell scripts, etc.
26
+ * Plugins to help install applications, via yum or manually unpacking, and building. Also to prompt for input, install gems, run shell scripts, etc.
27
27
  * Templates for init scripts and application configuration
28
28
  * Templates and recipes for common apps like monit, nginx, sphinx, mongrel, ruby and mysql
29
29
  * Common deployment setup and update_code tasks, such as symlinking in database.yml and more advanced recipes such as sphinx configuration.
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.3.4
4
+ version: 0.3.5
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-05-05 00:00:00 -04:00
12
+ date: 2008-05-08 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -24,8 +24,8 @@ dependencies:
24
24
  description: Capistrano recipes, plugins and templates.
25
25
  email:
26
26
  - gabrielh@gmail.com
27
- executables:
28
- - capitate
27
+ executables: []
28
+
29
29
  extensions: []
30
30
 
31
31
  extra_rdoc_files:
@@ -41,7 +41,6 @@ files:
41
41
  - Manifest.txt
42
42
  - README.txt
43
43
  - Rakefile
44
- - bin/capitate
45
44
  - config/hoe.rb
46
45
  - config/requirements.rb
47
46
  - docs/nginx.README
@@ -88,6 +87,7 @@ files:
88
87
  - lib/recipes/logrotate/sphinx.rb
89
88
  - lib/recipes/logrotated.rb
90
89
  - lib/recipes/memcached.rb
90
+ - lib/recipes/merb.rb
91
91
  - lib/recipes/monit.rb
92
92
  - lib/recipes/monit/backgroundjob.rb
93
93
  - lib/recipes/monit/backgroundrb.rb
data/bin/capitate DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- begin
4
- require 'capitate'
5
- rescue LoadError
6
- require 'rubygems'
7
- require 'capitate'
8
- end
9
-
10
- require 'capistrano/cli'
11
-
12
- cli = Capistrano::CLI.new(ARGV)
13
- cli.parse_options!
14
-
15
- config = cli.instantiate_configuration
16
- config.logger.level = cli.options[:verbose]
17
-
18
- cli.set_pre_vars(config)
19
- cli.load_recipes(config)
20
-
21
- config.load do
22
- require 'capitate/recipes'
23
- end
24
-
25
- config.trigger(:load)
26
- cli.execute_requested_actions(config)
27
- config.trigger(:exit)
28
-
29
-
30
-