whiskey_disk 0.0.7 → 0.3.0
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/.gitignore +0 -1
- data/README +152 -108
- data/TODO.txt +32 -12
- data/VERSION +1 -1
- data/bin/wd +36 -0
- data/lib/whiskey_disk/config.rb +79 -38
- data/lib/whiskey_disk/rake.rb +36 -0
- data/lib/whiskey_disk.rb +24 -11
- data/spec/wd_command_spec.rb +421 -0
- data/spec/whiskey_disk/config_spec.rb +356 -221
- data/spec/whiskey_disk/rake_spec.rb +255 -0
- data/spec/whiskey_disk_spec.rb +85 -19
- data/tasks/deploy.rake +1 -1
- data/whiskey_disk.gemspec +76 -0
- metadata +35 -15
- data/lib/tasks/deploy.rb +0 -37
- data/spec/tasks/deploy_spec.rb +0 -295
@@ -0,0 +1,255 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper.rb'))
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
describe 'rake tasks' do
|
5
|
+
before do
|
6
|
+
Rake.application = @rake = Rake::Application.new
|
7
|
+
load File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'whiskey_disk', 'rake.rb'))
|
8
|
+
WhiskeyDisk.reset
|
9
|
+
end
|
10
|
+
|
11
|
+
after do
|
12
|
+
Rake.application = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'deploy:setup' do
|
16
|
+
before do
|
17
|
+
@configuration = { }
|
18
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
19
|
+
[
|
20
|
+
:ensure_main_parent_path_is_present,
|
21
|
+
:ensure_config_parent_path_is_present,
|
22
|
+
:checkout_main_repository,
|
23
|
+
:install_hooks,
|
24
|
+
:checkout_configuration_repository,
|
25
|
+
:update_main_repository_checkout,
|
26
|
+
:update_configuration_repository_checkout,
|
27
|
+
:refresh_configuration,
|
28
|
+
:run_post_setup_hooks,
|
29
|
+
:flush
|
30
|
+
].each do |meth|
|
31
|
+
WhiskeyDisk.stub!(meth)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should make changes on the specified domain when a domain is specified' do
|
36
|
+
@configuration = { 'domain' => 'some domain' }
|
37
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
38
|
+
@rake["deploy:setup"].invoke
|
39
|
+
WhiskeyDisk.should.be.remote
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should make changes on the local system when no domain is specified' do
|
43
|
+
@configuration = { 'domain' => '' }
|
44
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
45
|
+
WhiskeyDisk.should.not.be.remote
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should ensure that the parent path for the main repository checkout is present' do
|
49
|
+
WhiskeyDisk.should.receive(:ensure_main_parent_path_is_present)
|
50
|
+
@rake["deploy:setup"].invoke
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'when a configuration repo is specified' do
|
54
|
+
it 'should ensure that the parent path for the configuration repository checkout is present' do
|
55
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(true)
|
56
|
+
WhiskeyDisk.should.receive(:ensure_config_parent_path_is_present)
|
57
|
+
@rake["deploy:setup"].invoke
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe 'when no configuration repo is specified' do
|
62
|
+
it 'should not ensure that the path for the configuration repository checkout is present' do
|
63
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(false)
|
64
|
+
WhiskeyDisk.should.not.receive(:ensure_config_parent_path_is_present)
|
65
|
+
@rake["deploy:setup"].invoke
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'should check out the main repository' do
|
70
|
+
WhiskeyDisk.should.receive(:checkout_main_repository)
|
71
|
+
@rake["deploy:setup"].invoke
|
72
|
+
end
|
73
|
+
|
74
|
+
describe 'when a configuration repository is specified' do
|
75
|
+
it 'should check out the configuration repository' do
|
76
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(true)
|
77
|
+
WhiskeyDisk.should.receive(:checkout_configuration_repository)
|
78
|
+
@rake["deploy:setup"].invoke
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe 'when no configuration repository is specified' do
|
83
|
+
it 'should not check out the configuration repository' do
|
84
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(false)
|
85
|
+
WhiskeyDisk.should.not.receive(:checkout_configuration_repository)
|
86
|
+
@rake["deploy:setup"].invoke
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should update the main repository checkout' do
|
91
|
+
WhiskeyDisk.should.receive(:update_main_repository_checkout)
|
92
|
+
@rake["deploy:setup"].invoke
|
93
|
+
end
|
94
|
+
|
95
|
+
describe 'when a configuration repository is specified' do
|
96
|
+
it 'should update the configuration repository checkout' do
|
97
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(true)
|
98
|
+
WhiskeyDisk.should.receive(:update_configuration_repository_checkout)
|
99
|
+
@rake["deploy:setup"].invoke
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe 'when no configuration repository is specified' do
|
104
|
+
it 'should update the configuration repository checkout' do
|
105
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(false)
|
106
|
+
WhiskeyDisk.should.not.receive(:update_configuration_repository_checkout)
|
107
|
+
@rake["deploy:setup"].invoke
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe 'when a configuration repository is specified' do
|
112
|
+
it 'should refresh the configuration' do
|
113
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(true)
|
114
|
+
WhiskeyDisk.should.receive(:refresh_configuration)
|
115
|
+
@rake["deploy:setup"].invoke
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe 'when no configuration repository is specified' do
|
120
|
+
it 'should not refresh the configuration' do
|
121
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(false)
|
122
|
+
WhiskeyDisk.should.not.receive(:refresh_configuration)
|
123
|
+
@rake["deploy:setup"].invoke
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
it 'should run any post setup hooks' do
|
128
|
+
WhiskeyDisk.should.receive(:run_post_setup_hooks)
|
129
|
+
@rake["deploy:setup"].invoke
|
130
|
+
end
|
131
|
+
|
132
|
+
it 'should flush WhiskeyDisk changes' do
|
133
|
+
WhiskeyDisk.should.receive(:flush)
|
134
|
+
@rake["deploy:setup"].invoke
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
describe 'deploy:now' do
|
139
|
+
before do
|
140
|
+
@configuration = { }
|
141
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
142
|
+
[
|
143
|
+
:update_main_repository_checkout,
|
144
|
+
:update_configuration_repository_checkout,
|
145
|
+
:refresh_configuration,
|
146
|
+
:run_post_deploy_hooks,
|
147
|
+
:flush
|
148
|
+
].each do |meth|
|
149
|
+
WhiskeyDisk.stub!(meth)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
it 'should make changes on the specified domain when a domain is specified' do
|
154
|
+
@configuration = { 'domain' => 'some domain'}
|
155
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
156
|
+
@rake["deploy:now"].invoke
|
157
|
+
WhiskeyDisk.should.be.remote
|
158
|
+
end
|
159
|
+
|
160
|
+
it 'should make changes on the local system when no domain is specified' do
|
161
|
+
WhiskeyDisk.should.not.be.remote
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'should update the main repository checkout' do
|
165
|
+
WhiskeyDisk.should.receive(:update_main_repository_checkout)
|
166
|
+
@rake["deploy:now"].invoke
|
167
|
+
end
|
168
|
+
|
169
|
+
describe 'when a configuration repository is specified' do
|
170
|
+
it 'should update the configuration repository checkout' do
|
171
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(true)
|
172
|
+
WhiskeyDisk.should.receive(:update_configuration_repository_checkout)
|
173
|
+
@rake["deploy:now"].invoke
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
describe 'when no configuration repository is specified' do
|
178
|
+
it 'should not update the configuration repository checkout' do
|
179
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(false)
|
180
|
+
WhiskeyDisk.should.not.receive(:update_configuration_repository_checkout)
|
181
|
+
@rake["deploy:now"].invoke
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
describe 'when a configuration repository is specified' do
|
186
|
+
it 'should refresh the configuration' do
|
187
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(true)
|
188
|
+
WhiskeyDisk.should.receive(:refresh_configuration)
|
189
|
+
@rake["deploy:now"].invoke
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
describe 'when no configuration repository is specified' do
|
194
|
+
it 'should not refresh the configuration' do
|
195
|
+
WhiskeyDisk.stub!(:has_config_repo?).and_return(false)
|
196
|
+
WhiskeyDisk.should.not.receive(:refresh_configuration)
|
197
|
+
@rake["deploy:now"].invoke
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
it 'should run any post deployment hooks' do
|
202
|
+
WhiskeyDisk.should.receive(:run_post_deploy_hooks)
|
203
|
+
@rake["deploy:now"].invoke
|
204
|
+
end
|
205
|
+
|
206
|
+
it 'should flush WhiskeyDisk changes' do
|
207
|
+
WhiskeyDisk.should.receive(:flush)
|
208
|
+
@rake["deploy:now"].invoke
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
describe 'deploy:post_setup' do
|
213
|
+
it 'should run the defined post_setup rake task when a post_setup rake task is defined for this environment' do
|
214
|
+
@configuration = { 'environment' => 'production'}
|
215
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
216
|
+
WhiskeyDisk.reset
|
217
|
+
|
218
|
+
task "deploy:production:post_setup" do
|
219
|
+
WhiskeyDisk.fake_method
|
220
|
+
end
|
221
|
+
|
222
|
+
WhiskeyDisk.should.receive(:fake_method)
|
223
|
+
Rake::Task['deploy:post_setup'].invoke
|
224
|
+
end
|
225
|
+
|
226
|
+
it 'should not fail when no post_setup rake task is defined for this environment' do
|
227
|
+
@configuration = { 'environment' => 'staging'}
|
228
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
229
|
+
WhiskeyDisk.reset
|
230
|
+
lambda { Rake::Task['deploy:post_setup'].invoke }.should.not.raise
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
describe 'deploy:post_deploy' do
|
235
|
+
it 'should run the defined post_deploy rake task when a post_deploy rake task is defined for this environment' do
|
236
|
+
@configuration = { 'environment' => 'production'}
|
237
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
238
|
+
WhiskeyDisk.reset
|
239
|
+
|
240
|
+
task "deploy:production:post_deploy" do
|
241
|
+
WhiskeyDisk.fake_method
|
242
|
+
end
|
243
|
+
|
244
|
+
WhiskeyDisk.should.receive(:fake_method)
|
245
|
+
Rake::Task['deploy:post_deploy'].invoke
|
246
|
+
end
|
247
|
+
|
248
|
+
it 'should not fail when no post_deploy rake task is defined for this environment' do
|
249
|
+
@configuration = { 'environment' => 'staging'}
|
250
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@configuration)
|
251
|
+
WhiskeyDisk.reset
|
252
|
+
lambda { Rake::Task['deploy:post_deploy'].invoke }.should.not.raise
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
data/spec/whiskey_disk_spec.rb
CHANGED
@@ -5,7 +5,7 @@ require 'rake'
|
|
5
5
|
describe 'requiring the main library' do
|
6
6
|
before do
|
7
7
|
Rake.application = @rake = Rake::Application.new
|
8
|
-
load File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', '
|
8
|
+
load File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'whiskey_disk', 'rake.rb'))
|
9
9
|
end
|
10
10
|
|
11
11
|
after do
|
@@ -22,6 +22,68 @@ describe 'requiring the main library' do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
describe 'WhiskeyDisk' do
|
25
|
+
describe 'determining if the deployment is remote' do
|
26
|
+
before do
|
27
|
+
@parameters = { 'deploy_to' => '/path/to/main/repo' }
|
28
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters)
|
29
|
+
WhiskeyDisk.reset
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should work without arguments' do
|
33
|
+
lambda { WhiskeyDisk.remote? }.should.not.raise(ArgumentError)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should not allow arguments' do
|
37
|
+
lambda { WhiskeyDisk.remote?(:foo) }.should.raise(ArgumentError)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should return true if the configuration includes a non-empty domain setting' do
|
41
|
+
@parameters['domain'] = 'smeghost'
|
42
|
+
WhiskeyDisk.remote?.should == true
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should return false if the configuration includes a nil domain setting' do
|
46
|
+
@parameters['domain'] = nil
|
47
|
+
WhiskeyDisk.remote?.should == false
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should return false if the configuration includes a blank domain setting' do
|
51
|
+
@parameters['domain'] = ''
|
52
|
+
WhiskeyDisk.remote?.should == false
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe 'determining if the deployment has a configuration repository' do
|
57
|
+
before do
|
58
|
+
@parameters = { 'deploy_to' => '/path/to/main/repo' }
|
59
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters)
|
60
|
+
WhiskeyDisk.reset
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should work without arguments' do
|
64
|
+
lambda { WhiskeyDisk.has_config_repo? }.should.not.raise(ArgumentError)
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'should not allow arguments' do
|
68
|
+
lambda { WhiskeyDisk.has_config_repo?(:foo) }.should.raise(ArgumentError)
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'should return true if the configuration includes a non-empty config_repository setting' do
|
72
|
+
@parameters['config_repository'] = 'git://foo.git'
|
73
|
+
WhiskeyDisk.has_config_repo?.should == true
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'should return false if the configuration includes a nil config_repository setting' do
|
77
|
+
@parameters['config_repository'] = nil
|
78
|
+
WhiskeyDisk.has_config_repo?.should == false
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'should return false if the configuration includes a blank config_repository setting' do
|
82
|
+
@parameters['config_repository'] = ''
|
83
|
+
WhiskeyDisk.has_config_repo?.should == false
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
25
87
|
describe 'ensuring that the parent path for the main repository checkout is present' do
|
26
88
|
before do
|
27
89
|
@parameters = { 'deploy_to' => '/path/to/main/repo' }
|
@@ -98,22 +160,6 @@ describe 'WhiskeyDisk' do
|
|
98
160
|
end
|
99
161
|
end
|
100
162
|
|
101
|
-
describe 'installing a post-receive hook on the checked out main repository' do
|
102
|
-
before do
|
103
|
-
@parameters = { 'deploy_to' => '/path/to/main/repo' }
|
104
|
-
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters)
|
105
|
-
WhiskeyDisk.reset
|
106
|
-
end
|
107
|
-
|
108
|
-
it 'should fail if the deployment path is not specified' do
|
109
|
-
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters.merge('deploy_to' => nil))
|
110
|
-
WhiskeyDisk.reset
|
111
|
-
lambda { WhiskeyDisk.install_hooks }.should.raise
|
112
|
-
end
|
113
|
-
|
114
|
-
# FIXME -- TODO: MORE HERE
|
115
|
-
end
|
116
|
-
|
117
163
|
describe 'checking out the configuration repository' do
|
118
164
|
before do
|
119
165
|
@parameters = { 'deploy_config_to' => '/path/to/config/repo', 'config_repository' => 'git@ogtastic.com:config.git' }
|
@@ -211,15 +257,29 @@ describe 'WhiskeyDisk' do
|
|
211
257
|
WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/config/repo})
|
212
258
|
end
|
213
259
|
|
214
|
-
it 'should attempt to fetch only the master branch from the origin' do
|
260
|
+
it 'should attempt to fetch only the master branch from the origin if no configuration branch is specified' do
|
215
261
|
WhiskeyDisk.update_configuration_repository_checkout
|
216
262
|
WhiskeyDisk.buffer.join(' ').should.match(%r{git fetch origin \+refs/heads/master:refs/remotes/origin/master})
|
217
263
|
end
|
218
264
|
|
219
|
-
it 'should attempt to
|
265
|
+
it 'should attempt to fetch the specified branch from the origin if a configuration branch is specified' do
|
266
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters.merge({'config_branch' => 'production'}))
|
267
|
+
WhiskeyDisk.reset
|
268
|
+
WhiskeyDisk.update_configuration_repository_checkout
|
269
|
+
WhiskeyDisk.buffer.join(' ').should.match(%r{git fetch origin \+refs/heads/production:refs/remotes/origin/production})
|
270
|
+
end
|
271
|
+
|
272
|
+
it 'should attempt to reset the master branch from the origin if no configuration branch is specified' do
|
220
273
|
WhiskeyDisk.update_configuration_repository_checkout
|
221
274
|
WhiskeyDisk.buffer.join(' ').should.match(%r{git reset --hard origin/master})
|
222
275
|
end
|
276
|
+
|
277
|
+
it 'should attempt to reset the master branch from the origin if no configuration branch is specified' do
|
278
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters.merge({'config_branch' => 'production'}))
|
279
|
+
WhiskeyDisk.reset
|
280
|
+
WhiskeyDisk.update_configuration_repository_checkout
|
281
|
+
WhiskeyDisk.buffer.join(' ').should.match(%r{git reset --hard origin/production})
|
282
|
+
end
|
223
283
|
end
|
224
284
|
|
225
285
|
describe 'refreshing the configuration' do
|
@@ -244,6 +304,12 @@ describe 'WhiskeyDisk' do
|
|
244
304
|
lambda { WhiskeyDisk.refresh_configuration }.should.raise
|
245
305
|
end
|
246
306
|
|
307
|
+
it 'should fail if no project name was specified' do
|
308
|
+
WhiskeyDisk::Config.stub!(:fetch).and_return(@parameters.merge('project' => 'unnamed_project'))
|
309
|
+
WhiskeyDisk.reset
|
310
|
+
lambda { WhiskeyDisk.refresh_configuration }.should.raise
|
311
|
+
end
|
312
|
+
|
247
313
|
it 'should use rsync to overlay the configuration checkout for the project in the configured environment onto the main checkout' do
|
248
314
|
WhiskeyDisk.refresh_configuration
|
249
315
|
WhiskeyDisk.buffer.last.should.match(%r{rsync.* /path/to/config/repo/whiskey_disk/production/ /path/to/main/repo/})
|
data/tasks/deploy.rake
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', '
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'whiskey_disk', 'rake'))
|
2
2
|
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{whiskey_disk}
|
8
|
+
s.version = "0.3.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Rick Bradley"]
|
12
|
+
s.date = %q{2010-06-17}
|
13
|
+
s.default_executable = %q{wd}
|
14
|
+
s.description = %q{Opinionated gem for doing fast git-based server deployments.}
|
15
|
+
s.email = %q{rick@rickbradley.com}
|
16
|
+
s.executables = ["wd"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".gitignore",
|
22
|
+
"MIT-LICENSE",
|
23
|
+
"README",
|
24
|
+
"Rakefile",
|
25
|
+
"TODO.txt",
|
26
|
+
"VERSION",
|
27
|
+
"WHY.txt",
|
28
|
+
"bin/wd",
|
29
|
+
"examples/deploy-staging.yml",
|
30
|
+
"examples/deploy.rake",
|
31
|
+
"examples/deploy.yml",
|
32
|
+
"init.rb",
|
33
|
+
"install.rb",
|
34
|
+
"lib/whiskey_disk.rb",
|
35
|
+
"lib/whiskey_disk/config.rb",
|
36
|
+
"lib/whiskey_disk/rake.rb",
|
37
|
+
"spec/.bacon",
|
38
|
+
"spec/init_spec.rb",
|
39
|
+
"spec/install_spec.rb",
|
40
|
+
"spec/spec_helper.rb",
|
41
|
+
"spec/wd_command_spec.rb",
|
42
|
+
"spec/whiskey_disk/config_spec.rb",
|
43
|
+
"spec/whiskey_disk/rake_spec.rb",
|
44
|
+
"spec/whiskey_disk_spec.rb",
|
45
|
+
"tasks/deploy.rake",
|
46
|
+
"whiskey_disk.gemspec"
|
47
|
+
]
|
48
|
+
s.homepage = %q{http://github.com/flogic/whiskey_disk}
|
49
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
50
|
+
s.require_paths = ["lib"]
|
51
|
+
s.rubygems_version = %q{1.3.7}
|
52
|
+
s.summary = %q{embarrassingly fast deployments.}
|
53
|
+
s.test_files = [
|
54
|
+
"spec/init_spec.rb",
|
55
|
+
"spec/install_spec.rb",
|
56
|
+
"spec/spec_helper.rb",
|
57
|
+
"spec/wd_command_spec.rb",
|
58
|
+
"spec/whiskey_disk/config_spec.rb",
|
59
|
+
"spec/whiskey_disk/rake_spec.rb",
|
60
|
+
"spec/whiskey_disk_spec.rb"
|
61
|
+
]
|
62
|
+
|
63
|
+
if s.respond_to? :specification_version then
|
64
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
65
|
+
s.specification_version = 3
|
66
|
+
|
67
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
68
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
71
|
+
end
|
72
|
+
else
|
73
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whiskey_disk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 19
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Rick Bradley
|
@@ -9,23 +15,27 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
13
|
-
default_executable:
|
18
|
+
date: 2010-06-17 00:00:00 -05:00
|
19
|
+
default_executable: wd
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: rake
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
25
35
|
description: Opinionated gem for doing fast git-based server deployments.
|
26
36
|
email: rick@rickbradley.com
|
27
|
-
executables:
|
28
|
-
|
37
|
+
executables:
|
38
|
+
- wd
|
29
39
|
extensions: []
|
30
40
|
|
31
41
|
extra_rdoc_files:
|
@@ -38,22 +48,25 @@ files:
|
|
38
48
|
- TODO.txt
|
39
49
|
- VERSION
|
40
50
|
- WHY.txt
|
51
|
+
- bin/wd
|
41
52
|
- examples/deploy-staging.yml
|
42
53
|
- examples/deploy.rake
|
43
54
|
- examples/deploy.yml
|
44
55
|
- init.rb
|
45
56
|
- install.rb
|
46
|
-
- lib/tasks/deploy.rb
|
47
57
|
- lib/whiskey_disk.rb
|
48
58
|
- lib/whiskey_disk/config.rb
|
59
|
+
- lib/whiskey_disk/rake.rb
|
49
60
|
- spec/.bacon
|
50
61
|
- spec/init_spec.rb
|
51
62
|
- spec/install_spec.rb
|
52
63
|
- spec/spec_helper.rb
|
53
|
-
- spec/
|
64
|
+
- spec/wd_command_spec.rb
|
54
65
|
- spec/whiskey_disk/config_spec.rb
|
66
|
+
- spec/whiskey_disk/rake_spec.rb
|
55
67
|
- spec/whiskey_disk_spec.rb
|
56
68
|
- tasks/deploy.rake
|
69
|
+
- whiskey_disk.gemspec
|
57
70
|
has_rdoc: true
|
58
71
|
homepage: http://github.com/flogic/whiskey_disk
|
59
72
|
licenses: []
|
@@ -64,21 +77,27 @@ rdoc_options:
|
|
64
77
|
require_paths:
|
65
78
|
- lib
|
66
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
67
81
|
requirements:
|
68
82
|
- - ">="
|
69
83
|
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
70
87
|
version: "0"
|
71
|
-
version:
|
72
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
73
90
|
requirements:
|
74
91
|
- - ">="
|
75
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 3
|
94
|
+
segments:
|
95
|
+
- 0
|
76
96
|
version: "0"
|
77
|
-
version:
|
78
97
|
requirements: []
|
79
98
|
|
80
99
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.3.
|
100
|
+
rubygems_version: 1.3.7
|
82
101
|
signing_key:
|
83
102
|
specification_version: 3
|
84
103
|
summary: embarrassingly fast deployments.
|
@@ -86,6 +105,7 @@ test_files:
|
|
86
105
|
- spec/init_spec.rb
|
87
106
|
- spec/install_spec.rb
|
88
107
|
- spec/spec_helper.rb
|
89
|
-
- spec/
|
108
|
+
- spec/wd_command_spec.rb
|
90
109
|
- spec/whiskey_disk/config_spec.rb
|
110
|
+
- spec/whiskey_disk/rake_spec.rb
|
91
111
|
- spec/whiskey_disk_spec.rb
|
data/lib/tasks/deploy.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'whiskey_disk'))
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
namespace :deploy do
|
5
|
-
desc "Perform initial setup for deployment"
|
6
|
-
task :setup do
|
7
|
-
WhiskeyDisk.ensure_main_parent_path_is_present if WhiskeyDisk.remote?
|
8
|
-
WhiskeyDisk.ensure_config_parent_path_is_present
|
9
|
-
WhiskeyDisk.checkout_main_repository if WhiskeyDisk.remote?
|
10
|
-
WhiskeyDisk.install_hooks if WhiskeyDisk.remote?
|
11
|
-
WhiskeyDisk.checkout_configuration_repository
|
12
|
-
WhiskeyDisk.update_main_repository_checkout if WhiskeyDisk.remote?
|
13
|
-
WhiskeyDisk.update_configuration_repository_checkout
|
14
|
-
WhiskeyDisk.refresh_configuration
|
15
|
-
WhiskeyDisk.run_post_setup_hooks
|
16
|
-
WhiskeyDisk.flush
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Deploy now."
|
20
|
-
task :now do
|
21
|
-
WhiskeyDisk.update_main_repository_checkout if WhiskeyDisk.remote?
|
22
|
-
WhiskeyDisk.update_configuration_repository_checkout
|
23
|
-
WhiskeyDisk.refresh_configuration
|
24
|
-
WhiskeyDisk.run_post_deploy_hooks
|
25
|
-
WhiskeyDisk.flush
|
26
|
-
end
|
27
|
-
|
28
|
-
task :post_setup do
|
29
|
-
env = WhiskeyDisk[:environment]
|
30
|
-
Rake::Task["deploy:#{env}:post_setup"].invoke if Rake::Task.task_defined? "deploy:#{env}:post_setup"
|
31
|
-
end
|
32
|
-
|
33
|
-
task :post_deploy do
|
34
|
-
env = WhiskeyDisk[:environment]
|
35
|
-
Rake::Task["deploy:#{env}:post_deploy"].invoke if Rake::Task.task_defined? "deploy:#{env}:post_deploy"
|
36
|
-
end
|
37
|
-
end
|