capistrano-windows-server 0.4.1 → 0.4.2
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/README.md +3 -14
- data/VERSION +1 -1
- data/capistrano-windows-server.gemspec +2 -2
- data/lib/capistrano/ext/windows_server.rb +23 -17
- metadata +8 -8
data/README.md
CHANGED
@@ -17,10 +17,9 @@ but some things you might expect from a normal capistrano deploy are not possibl
|
|
17
17
|
Windows filesystems do not support symlinks, and files cannot be moved or deleted while they are in use (the server is running).
|
18
18
|
|
19
19
|
* Your app will deploy directly to #{deploy_to}/current and update in-place.
|
20
|
-
When you deploy, capistrano is essentially doing a git
|
20
|
+
When you deploy, capistrano is essentially doing a git reset --hard <deploy commit>.
|
21
21
|
* There is no releases/ directory, and only one copy of your app will be on the server at any time.
|
22
22
|
This means that you cannot roll back.
|
23
|
-
* Git submodules are not yet supported by WindowsGit. Instructions for dealing with that are below.
|
24
23
|
|
25
24
|
### Server stack
|
26
25
|
|
@@ -168,18 +167,6 @@ Once it's ready, you can deploy your app for the first time:
|
|
168
167
|
|
169
168
|
cap deploy:cold
|
170
169
|
|
171
|
-
### Submodules
|
172
|
-
|
173
|
-
Unfortunately, WindowsGit [does not currently support submodules](https://github.com/SciMed/capistrano-windows-server/issues/1).
|
174
|
-
|
175
|
-
If your project uses submodules, there are a few ways you can deal with this.
|
176
|
-
|
177
|
-
* Do it by hand - manually clone each submodule after your initial deploy
|
178
|
-
* Install another git distribution (msysgit, PortableGit), and run git submodule init/update in your project directory
|
179
|
-
* Pull the missing files out of another git distribution (msysgit, PortableGit) and copy them to C:\Program Files\ICW\bin .
|
180
|
-
If you go this route, please document the process on [this issue](https://github.com/SciMed/capistrano-windows-server/issues/1),
|
181
|
-
so we can update this documentation.
|
182
|
-
|
183
170
|
|
184
171
|
Which cap tasks are available?
|
185
172
|
------------------------------
|
@@ -204,6 +191,8 @@ The following new tasks were added:
|
|
204
191
|
* `cap deploy:mongrel:setup` - Create mongrel services
|
205
192
|
* `cap deploy:mongrel:remove` - Remove mongrel services
|
206
193
|
* `cap rake` - Run a rake task, specified by COMMAND. eg: cap rake COMMAND="gems:install"
|
194
|
+
* `cap rubygems` - Run a gem command, specified by COMMAND. eg: cap rubygems COMMAND="install rails"
|
195
|
+
* `cap git` - Run a git command, specified by COMMAND. eg: cap rake COMMAND="status"
|
207
196
|
|
208
197
|
The following tasks will later be fixed:
|
209
198
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
@@ -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.
|
8
|
+
s.version = "0.4.2"
|
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-08-
|
12
|
+
s.date = %q{2011-08-22}
|
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.}
|
@@ -6,24 +6,22 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
|
|
6
6
|
configuration.load do
|
7
7
|
set :scm, :git
|
8
8
|
set :deploy_via, :remote_cache
|
9
|
-
#set :git_enable_submodules, false # Git submodules not supported on windows
|
10
9
|
set :shared_dir, "."
|
11
10
|
set :repository_cache, "current"
|
12
11
|
set :scm_verbose, true
|
13
12
|
set :use_sudo, false
|
14
13
|
|
15
|
-
# We can't run
|
16
|
-
def
|
17
|
-
"#{ruby_exe_path} -e \"require 'rubygems'; gem '
|
14
|
+
# 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
|
+
def ruby_cmd(cmd)
|
16
|
+
"PATH=\"#{File.dirname ruby_exe_path}:$PATH\" #{ruby_exe_path} -e \"require 'rubygems'; gem '#{cmd}', '>= 0'; load '#{cmd}'\""
|
18
17
|
end
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
"#{ruby_exe_path} -e \"require 'rubygems'; gem 'mongrel', '>= 0'; load 'mongrel_rails'\""
|
19
|
+
def rubygems_cmd
|
20
|
+
"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\""
|
23
21
|
end
|
24
22
|
|
25
23
|
namespace :deploy do
|
26
|
-
desc "Update the code on the server by doing a git
|
24
|
+
desc "Update the code on the server by doing a git reset --hard <ref> in the current/ directory"
|
27
25
|
task :update do
|
28
26
|
# update_repository_cache will attempt to clean out the repository; we must prevent that.
|
29
27
|
# /bin/git below is where www.windowsgit.com's windows git/ssh installation puts the git executable.
|
@@ -78,7 +76,7 @@ configuration.load do
|
|
78
76
|
|
79
77
|
desc "Run pending migrations"
|
80
78
|
task :migrate do
|
81
|
-
run "cd #{current_path} && #{
|
79
|
+
run "cd #{current_path} && #{ruby_cmd 'rake'} db:migrate RAILS_ENV=#{rails_env}"
|
82
80
|
end
|
83
81
|
|
84
82
|
desc "Start mongrel"
|
@@ -108,15 +106,15 @@ configuration.load do
|
|
108
106
|
task :setup do
|
109
107
|
mongrel_instances.each do |n|
|
110
108
|
run "mkdir -p #{current_path}/{tmp,log}" # These are often not under version control, but their absence keeps mongrel from recognizing the rails app
|
111
|
-
run "cd #{current_path} && #{
|
112
|
-
run %Q(sc.exe config "#{mongrel_instance_prefix}#{n}" start= auto)
|
109
|
+
run "cd #{current_path} && #{ruby_cmd 'mongrel'} service::install -e #{rails_env} -N #{mongrel_instance_prefix}#{n} -p #{base_port + n - mongrel_instances.first}; true"
|
110
|
+
run %Q(sc.exe config "#{mongrel_instance_prefix}#{n}" start= auto; true)
|
113
111
|
end
|
114
112
|
end
|
115
113
|
|
116
114
|
desc "Remove mongrel services"
|
117
115
|
task :remove do
|
118
116
|
mongrel_instances.each do |n|
|
119
|
-
run "#{
|
117
|
+
run "#{ruby_cmd 'mongrel'} service::remove -N #{mongrel_instance_prefix}#{n}; true"
|
120
118
|
end
|
121
119
|
end
|
122
120
|
|
@@ -127,13 +125,21 @@ configuration.load do
|
|
127
125
|
desc "Run a rake command in COMMAND"
|
128
126
|
task :rake do
|
129
127
|
raise "Specify the command with COMMAND='some:task with_arguments'" unless ENV['COMMAND']
|
130
|
-
run "cd #{current_path} && #{
|
128
|
+
run "cd #{current_path} && #{ruby_cmd 'rake'} #{ENV['COMMAND']} RAILS_ENV=#{rails_env}"
|
131
129
|
end
|
132
130
|
|
133
|
-
desc "Run a
|
134
|
-
task :
|
135
|
-
raise "Specify the command with COMMAND
|
136
|
-
run "cd #{current_path} &&
|
131
|
+
desc "Run a rubygems (gem) command in COMMAND"
|
132
|
+
task :rubygems do
|
133
|
+
raise "Specify the command with COMMAND='install rails'" unless ENV['COMMAND']
|
134
|
+
run "cd #{current_path} && #{rubygems_cmd} #{ENV['COMMAND']}"
|
135
|
+
end
|
136
|
+
|
137
|
+
namespace :git do
|
138
|
+
desc "Run a git command in COMMAND"
|
139
|
+
task :execute do
|
140
|
+
raise "Specify the command with COMMAND. eg: COMMAND='diff HEAD^^'" unless ENV['COMMAND']
|
141
|
+
run "cd #{current_path} && git #{ENV['COMMAND']}"
|
142
|
+
end
|
137
143
|
end
|
138
144
|
|
139
145
|
after 'deploy:setup', 'deploy:update_code'
|
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:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 2
|
10
|
+
version: 0.4.2
|
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-08-
|
18
|
+
date: 2011-08-22 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
prerelease: false
|
23
|
-
name: capistrano
|
24
22
|
type: :runtime
|
23
|
+
name: capistrano
|
24
|
+
prerelease: false
|
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
|
-
prerelease: false
|
37
|
-
name: jeweler
|
38
36
|
type: :development
|
37
|
+
name: jeweler
|
38
|
+
prerelease: false
|
39
39
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|