siefca-vlad 1.2.0 → 1.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,8 +16,11 @@ lib/vlad/git.rb
16
16
  lib/vlad/lighttpd.rb
17
17
  lib/vlad/mercurial.rb
18
18
  lib/vlad/mongrel.rb
19
+ lib/vlad/nginx.rb
19
20
  lib/vlad/perforce.rb
20
21
  lib/vlad/subversion.rb
22
+ lib/vlad/thin.rb
23
+ lib/vlad/web.rb
21
24
  test/test_rake_remote_task.rb
22
25
  test/test_vlad.rb
23
26
  test/test_vlad_git.rb
@@ -0,0 +1,36 @@
1
+ require 'vlad'
2
+
3
+ namespace :vlad do
4
+ ##
5
+ # Nginx web server on Gentoo/Debian init.d systems
6
+
7
+ set :web_command, "/etc/init.d/nginx"
8
+
9
+ desc "(Re)Start the web servers"
10
+
11
+ remote_task :start_web, :roles => :web do
12
+ run "#{web_command} restart"
13
+ end
14
+
15
+ desc "Stop the web servers"
16
+
17
+ remote_task :stop_web, :roles => :web do
18
+ run "#{web_command} stop"
19
+ end
20
+
21
+ ##
22
+ # Everything HTTP.
23
+
24
+ desc "(Re)Start the web and app servers"
25
+ remote_task :start do
26
+ Rake::Task['vlad:start_app'].invoke
27
+ Rake::Task['vlad:start_web'].invoke
28
+ end
29
+
30
+ desc "Stop the web and app servers"
31
+
32
+ remote_task :stop do
33
+ Rake::Task['vlad:stop_app'].invoke
34
+ Rake::Task['vlad:stop_web'].invoke
35
+ end
36
+ end
@@ -0,0 +1,64 @@
1
+ # $GEM_HOME/gems/vlad-1.2.0/lib/vlad/thin.rb
2
+ # Thin tasks for Vlad the Deployer
3
+ # By cnantais
4
+ require 'vlad'
5
+
6
+ namespace :vlad do
7
+ ##
8
+ # Thin app server
9
+
10
+ set :thin_address, "127.0.0.1"
11
+ set :thin_command, 'thin'
12
+ set(:thin_conf) { "#{shared_path}/thin_cluster.conf" }
13
+ set :thin_environment, "production"
14
+ set :thin_group, nil
15
+ set :thin_log_file, nil
16
+ set :thin_pid_file, nil
17
+ set :thin_port, nil
18
+ set :thin_socket, nil
19
+ set :thin_prefix, nil
20
+ set :thin_servers, 2
21
+ set :thin_user, nil
22
+
23
+ desc "Prepares application servers for deployment. thin
24
+ configuration is set via the thin_* variables.".cleanup
25
+
26
+ remote_task :setup_app, :roles => :app do
27
+
28
+ raise(ArgumentError, "Please provide either thin_socket or thin_port") if thin_port.nil? && thin_socket.nil?
29
+
30
+ cmd = [
31
+ "#{thin_command} config",
32
+ "-s #{thin_servers}",
33
+ ("-S #{thin_socket}" if thin_socket),
34
+ "-e #{thin_environment}",
35
+ "-a #{thin_address}",
36
+ "-c #{current_path}",
37
+ "-C #{thin_conf}",
38
+ ("-P #{thin_pid_file}" if thin_pid_file),
39
+ ("-l #{thin_log_file}" if thin_log_file),
40
+ ("--user #{thin_user}" if thin_user),
41
+ ("--group #{thin_group}" if thin_group),
42
+ ("--prefix #{thin_prefix}" if thin_prefix),
43
+ ("-p #{thin_port}" if thin_port),
44
+ ].compact.join ' '
45
+
46
+ run cmd
47
+ end
48
+
49
+ def thin(cmd) # :nodoc:
50
+ "#{thin_command} #{cmd} -C #{thin_conf}"
51
+ end
52
+
53
+ desc "Restart the app servers"
54
+
55
+ remote_task :start_app, :roles => :app do
56
+ run thin("restart -s #{thin_servers}")
57
+ end
58
+
59
+ desc "Stop the app servers"
60
+
61
+ remote_task :stop_app, :roles => :app do
62
+ run thin("stop -s #{thin_servers}")
63
+ end
64
+ end
@@ -0,0 +1,12 @@
1
+ require 'vlad'
2
+
3
+ namespace :vlad do
4
+ namespace :web do
5
+ remote_task :enable, :roles => [:web] do
6
+ run "if [ -f #{shared_path}/system/maintenance.html ]; then rm -f #{shared_path}/system/maintenance.html; fi"
7
+ end
8
+ remote_task :disable, :roles => [:web] do
9
+ run "cp -f #{shared_path}/config/maintenance.html #{shared_path}/system/"
10
+ end
11
+ end
12
+ end
@@ -54,7 +54,7 @@ class Rake::RemoteTask
54
54
  end
55
55
 
56
56
  class VladTestCase < Test::Unit::TestCase
57
- undef_method :default_test
57
+ undef_method :default_test if self.respond_to?(:default_test)
58
58
 
59
59
  def setup
60
60
  @vlad = Rake::RemoteTask
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: siefca-vlad
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-02-25 00:00:00 -08:00
14
+ date: 2009-03-02 00:00:00 -08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -79,8 +79,11 @@ files:
79
79
  - lib/vlad/lighttpd.rb
80
80
  - lib/vlad/mercurial.rb
81
81
  - lib/vlad/mongrel.rb
82
+ - lib/vlad/nginx.rb
82
83
  - lib/vlad/perforce.rb
83
84
  - lib/vlad/subversion.rb
85
+ - lib/vlad/thin.rb
86
+ - lib/vlad/web.rb
84
87
  - test/test_rake_remote_task.rb
85
88
  - test/test_vlad.rb
86
89
  - test/test_vlad_git.rb