capistrano-windows-server 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- capistrano (2.6.0)
4
+ capistrano (2.9.0)
5
5
  highline
6
6
  net-scp (>= 1.0.0)
7
7
  net-sftp (>= 2.0.0)
8
8
  net-ssh (>= 2.0.14)
9
9
  net-ssh-gateway (>= 1.1.0)
10
10
  git (1.2.5)
11
- highline (1.6.2)
11
+ highline (1.6.9)
12
12
  jeweler (1.6.4)
13
13
  bundler (~> 1.0)
14
14
  git (>= 1.2.5)
@@ -17,12 +17,13 @@ GEM
17
17
  net-ssh (>= 1.99.1)
18
18
  net-sftp (2.0.5)
19
19
  net-ssh (>= 2.0.9)
20
- net-ssh (2.1.4)
20
+ net-ssh (2.3.0)
21
21
  net-ssh-gateway (1.1.0)
22
22
  net-ssh (>= 1.99.1)
23
- rake (0.8.7)
23
+ rake (0.9.2.2)
24
24
 
25
25
  PLATFORMS
26
+ java
26
27
  ruby
27
28
 
28
29
  DEPENDENCIES
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4
1
+ 0.4.5
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capistrano-windows-server}
8
- s.version = "0.4.4"
8
+ s.version = "0.4.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edward Anderson"]
12
- s.date = %q{2011-09-27}
12
+ s.date = %q{2012-02-20}
13
13
  s.description = %q{This gem modifies capistrano recipes to allow deploys to windows machines.
14
14
  Several nuances such as the lack of symlinks make the deploy a little different, but it's better than doing it by hand.
15
15
  See the github page for instruction on how to set up Windows to get it ready for a deploy.}
@@ -11,6 +11,14 @@ configuration.load do
11
11
  set :scm_verbose, true
12
12
  set :use_sudo, false
13
13
 
14
+ def strip_cygdrive(path)
15
+ path.sub /\/cygdrive\/([c-z])\//, '\1:/'
16
+ end
17
+
18
+ def latest_release
19
+ strip_cygdrive current_path
20
+ end
21
+
14
22
  # We can't run ruby commands directly, because the rake script searches for ruby based on windows paths that aren't valid in this environment
15
23
  def ruby_cmd(gem, cmd=gem)
16
24
  "PATH=\"#{File.dirname ruby_exe_path}:$PATH\" #{ruby_exe_path} -e \"require 'rubygems'; gem '#{gem}', '>= 0'; load Gem.bin_path('#{gem}', '#{cmd}', '>= 0')\""
@@ -19,10 +27,14 @@ configuration.load do
19
27
  def rubygems_cmd
20
28
  "PATH=\"#{File.dirname ruby_exe_path}:$PATH\" #{ruby_exe_path} -e \"require 'rubygems';require 'rubygems/gem_runner';require 'rubygems/exceptions';Gem::GemRunner.new.run ARGV.clone\""
21
29
  end
30
+
31
+ def application_server
32
+ app_server rescue :mongrel
33
+ end
22
34
 
23
35
  namespace :deploy do
24
36
  desc "Update the code on the server by doing a git reset --hard <ref> in the current/ directory"
25
- task :update do
37
+ task :update_code do
26
38
  # update_repository_cache will attempt to clean out the repository; we must prevent that.
27
39
  # /bin/git below is where www.windowsgit.com's windows git/ssh installation puts the git executable.
28
40
  # This creates a git proxy that goes in $PATH before /bin, which will filter out any `git clean` commands.
@@ -36,11 +48,7 @@ configuration.load do
36
48
  RUN
37
49
 
38
50
  strategy.send 'update_repository_cache'
39
- end
40
-
41
- desc "An alias for deploy:update"
42
- task :update_code do
43
- update
51
+ finalize_update
44
52
  end
45
53
 
46
54
  desc <<-DESC
@@ -64,7 +72,7 @@ configuration.load do
64
72
  end
65
73
  end
66
74
 
67
- # Remove tasks that are not appropriate on Windows
75
+ # Clear out tasks that are not appropriate on Windows
68
76
  %w(finalize_update symlink cleanup).each do |removed_task|
69
77
  task removed_task do; end
70
78
  end
@@ -81,6 +89,7 @@ configuration.load do
81
89
 
82
90
  desc "Start mongrel"
83
91
  task :start do
92
+ return unless application_server == :mongrel
84
93
  mongrel_instances.each do |n|
85
94
  run "net start #{mongrel_instance_prefix}#{n}; true"
86
95
  end
@@ -88,6 +97,7 @@ configuration.load do
88
97
 
89
98
  desc "Stop mongrel"
90
99
  task :stop do
100
+ return unless application_server == :mongrel
91
101
  mongrel_instances.each do |n|
92
102
  run "net stop #{mongrel_instance_prefix}#{n}; true"
93
103
  end
@@ -95,6 +105,7 @@ configuration.load do
95
105
 
96
106
  desc "Restart mongrel"
97
107
  task :restart do
108
+ return unless application_server == :mongrel
98
109
  mongrel_instances.each do |n|
99
110
  run "net stop #{mongrel_instance_prefix}#{n}; true"
100
111
  run "net start #{mongrel_instance_prefix}#{n}; true"
@@ -104,6 +115,7 @@ configuration.load do
104
115
  namespace :mongrel do
105
116
  desc "Create mongrel services"
106
117
  task :setup do
118
+ return unless application_server == :mongrel
107
119
  mongrel_instances.each do |n|
108
120
  run "mkdir -p #{current_path}/{tmp,log}" # These are often not under version control, but their absence keeps mongrel from recognizing the rails app
109
121
  run "cd #{current_path} && #{ruby_cmd 'mongrel', 'mongrel_rails'} service::install -e #{rails_env} -N #{mongrel_instance_prefix}#{n} -p #{base_port + n - mongrel_instances.first}; true"
@@ -142,6 +154,19 @@ configuration.load do
142
154
  end
143
155
  end
144
156
 
157
+ namespace :bundle do
158
+ desc "Install gems with bundler"
159
+ task :install do
160
+ run "cd #{current_path} && #{ruby_cmd 'bundler', 'bundle'} install --without test development --path #{strip_cygdrive deploy_to}/bundle"
161
+ end
162
+
163
+ desc "Execute a COMMAND with bundle exec"
164
+ task :execute do
165
+ raise "Specify the command with COMMAND. eg: COMMAND='rake db:migrate'" unless ENV['COMMAND']
166
+ run "cd #{current_path} && #{ruby_cmd 'bundler', 'bundle'} exec #{ENV['COMMAND']}"
167
+ end
168
+ end
169
+
145
170
  after 'deploy:setup', 'deploy:update_code'
146
171
  after 'deploy:setup', 'deploy:mongrel:setup'
147
172
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-windows-server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 4
10
- version: 0.4.4
9
+ - 5
10
+ version: 0.4.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Edward Anderson
@@ -15,13 +15,13 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-27 00:00:00 -04:00
18
+ date: 2012-02-20 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- name: capistrano
24
22
  prerelease: false
23
+ name: capistrano
24
+ type: :runtime
25
25
  version_requirements: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
@@ -33,9 +33,9 @@ dependencies:
33
33
  version: "0"
34
34
  requirement: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- type: :development
37
- name: jeweler
38
36
  prerelease: false
37
+ name: jeweler
38
+ type: :development
39
39
  version_requirements: &id002 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements: