public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Add tasks for Vlad the Deployer in example/vlad.rake [cnantais]
macournoyer (author)
Thu Feb 07 07:45:31 -0800 2008
commit  74c348b278bbfa423c1728942ff6ce2529276190
tree    203a49cc1c09f81f60f0b277cf95d0e927794aa6
parent  3e406d56b4d618cd89b18a4c9a7c20a2542a883a
...
1
 
2
3
4
5
...
17
18
19
20
21
 
 
22
23
 
24
25
26
...
1
2
3
4
5
6
...
18
19
20
 
 
21
22
23
 
24
25
26
27
0
@@ -1,4 +1,5 @@
0
 == 0.6.3 Ninja Cookie release
0
+ * Add tasks for Vlad the Deployer in example/vlad.rake [cnantais]
0
  * Add Ramaze Rackup config file in example dir [tmm1]
0
    Use like this from you Ramaze app dir:
0
    
0
0
@@ -17,10 +18,10 @@
0
      
0
  * thin config --chrdir ... -C thin/yml do not change current directory anymore, fixes #33.
0
  * Add a better sample god config file in example/thin.god that loads all info from config
0
- files in /etc/thin [Gump].
0
- * Add support for specifying a custom Connector to the server and a more doc about Server
0
+ files in /etc/thin. Drop-in replacement for the thin runlevel service [Gump].
0
+ * Add support for specifying a custom Connector to the server and add more doc about Server
0
    configuration.
0
- * Add a script to run thin as a system service that can start at startup, closes #31 [Gump]
0
+ * Add a script to run thin as a runlevel service that can start at startup, closes #31 [Gump]
0
    Setup the service like this:
0
    
0
      sudo thin install /etc/thin
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
0
@@ -1 +1,62 @@
0
+# $GEM_HOME/gems/vlad-1.2.0/lib/vlad/thin.rb
0
+# Thin tasks for Vlad the Deployer
0
+# By cnantais
0
+require 'vlad'
0
+
0
+namespace :vlad do
0
+ ##
0
+ # Thin app server
0
+
0
+ set :thin_address, "127.0.0.1"
0
+ set :thin_command, 'thin'
0
+ set(:thin_conf) { "#{shared_path}/thin_cluster.conf" }
0
+ set :thin_environment, "production"
0
+ set :thin_group, nil
0
+ set :thin_log_file, nil
0
+ set :thin_pid_file, nil
0
+ set :thin_port, nil
0
+ set :thin_socket, "/tmp/thin.sock"
0
+ set :thin_prefix, nil
0
+ set :thin_servers, 2
0
+ set :thin_user, nil
0
+
0
+ desc "Prepares application servers for deployment. thin
0
+configuration is set via the thin_* variables.".cleanup
0
+
0
+ remote_task :setup_app, :roles => :app do
0
+ cmd = [
0
+ "#{thin_command} config",
0
+ "-s #{thin_servers}",
0
+ "-S #{thin_socket}",
0
+ "-e #{thin_environment}",
0
+ "-a #{thin_address}",
0
+ "-c #{current_path}",
0
+ "-C #{thin_conf}",
0
+ ("-P #{thin_pid_file}" if thin_pid_file),
0
+ ("-l #{thin_log_file}" if thin_log_file),
0
+ ("--user #{thin_user}" if thin_user),
0
+ ("--group #{thin_group}" if thin_group),
0
+ ("--prefix #{thin_prefix}" if thin_prefix),
0
+ ("-p #{thin_port}" if thin_port),
0
+ ].compact.join ' '
0
+
0
+ run cmd
0
+ end
0
+
0
+ def thin(cmd) # :nodoc:
0
+ "#{thin_command} #{cmd} -C #{thin_conf}"
0
+ end
0
+
0
+ desc "Restart the app servers"
0
+
0
+ remote_task :start_app, :roles => :app do
0
+ run thin("restart -s #{thin_servers}")
0
+ end
0
+
0
+ desc "Stop the app servers"
0
+
0
+ remote_task :stop_app, :roles => :app do
0
+ run thin("stop -s #{thin_servers}")
0
+ end
0
+end

Comments

    No one has commented yet.