whiskey_disk 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/VERSION +1 -1
- data/lib/whiskey_disk.rb +1 -1
- data/spec/whiskey_disk_spec.rb +22 -2
- data/whiskey_disk.gemspec +2 -3
- metadata +4 -5
- data/TODO.txt +0 -36
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.4
|
data/lib/whiskey_disk.rb
CHANGED
@@ -194,7 +194,7 @@ class WhiskeyDisk
|
|
194
194
|
def run_script(script)
|
195
195
|
return unless script
|
196
196
|
path = build_path(script)
|
197
|
-
enqueue("if [ -e #{path} ]; then sh -x #{path}; fi ")
|
197
|
+
enqueue("if [ -e #{path} ]; then cd #{self[:deploy_to]}; sh -x #{path}; fi ")
|
198
198
|
end
|
199
199
|
|
200
200
|
def ensure_main_parent_path_is_present
|
data/spec/whiskey_disk_spec.rb
CHANGED
@@ -357,6 +357,11 @@ describe 'WhiskeyDisk' do
|
|
357
357
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/setup/script})
|
358
358
|
end
|
359
359
|
|
360
|
+
it 'should cd to the deploy_to path prior to running the script' do
|
361
|
+
WhiskeyDisk.run_post_setup_hooks
|
362
|
+
WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/setup/script})
|
363
|
+
end
|
364
|
+
|
360
365
|
it 'should use an absolute path to run the post setup script when the script path starts with a "/"' do
|
361
366
|
WhiskeyDisk.run_post_setup_hooks
|
362
367
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/setup/script})
|
@@ -378,7 +383,12 @@ describe 'WhiskeyDisk' do
|
|
378
383
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/setup/script})
|
379
384
|
end
|
380
385
|
|
381
|
-
it 'should
|
386
|
+
it 'should cd to the deploy_to path prior to running the script' do
|
387
|
+
WhiskeyDisk.run_post_setup_hooks
|
388
|
+
WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/main/repo/path/to/setup/script})
|
389
|
+
end
|
390
|
+
|
391
|
+
it 'should use a path relative to the setup path to run the post setup script' do
|
382
392
|
WhiskeyDisk.run_post_setup_hooks
|
383
393
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/main/repo/path/to/setup/script})
|
384
394
|
end
|
@@ -454,7 +464,12 @@ describe 'WhiskeyDisk' do
|
|
454
464
|
WhiskeyDisk.run_post_deploy_hooks
|
455
465
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/deployment/script})
|
456
466
|
end
|
457
|
-
|
467
|
+
|
468
|
+
it 'should cd to the deploy_to path prior to running the script' do
|
469
|
+
WhiskeyDisk.run_post_deploy_hooks
|
470
|
+
WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/deployment/script})
|
471
|
+
end
|
472
|
+
|
458
473
|
it 'should use an absolute path to run the post deployment script when the script path starts with a "/"' do
|
459
474
|
WhiskeyDisk.run_post_deploy_hooks
|
460
475
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/deployment/script})
|
@@ -476,6 +491,11 @@ describe 'WhiskeyDisk' do
|
|
476
491
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/deployment/script})
|
477
492
|
end
|
478
493
|
|
494
|
+
it 'should cd to the deploy_to path prior to running the script' do
|
495
|
+
WhiskeyDisk.run_post_deploy_hooks
|
496
|
+
WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/main/repo/path/to/deployment/script})
|
497
|
+
end
|
498
|
+
|
479
499
|
it 'should use a path relative to the deployment path to run the post deployment script' do
|
480
500
|
WhiskeyDisk.run_post_deploy_hooks
|
481
501
|
WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/main/repo/path/to/deployment/script})
|
data/whiskey_disk.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{whiskey_disk}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rick Bradley"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-26}
|
13
13
|
s.description = %q{Opinionated gem for doing fast git-based server deployments.}
|
14
14
|
s.email = %q{rick@rickbradley.com}
|
15
15
|
s.executables = ["wd_role", "wd"]
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
"MIT-LICENSE",
|
22
22
|
"README.markdown",
|
23
23
|
"Rakefile",
|
24
|
-
"TODO.txt",
|
25
24
|
"VERSION",
|
26
25
|
"WHY.txt",
|
27
26
|
"bin/wd",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whiskey_disk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 4
|
10
|
+
version: 0.6.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rick Bradley
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-26 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -46,7 +46,6 @@ files:
|
|
46
46
|
- MIT-LICENSE
|
47
47
|
- README.markdown
|
48
48
|
- Rakefile
|
49
|
-
- TODO.txt
|
50
49
|
- VERSION
|
51
50
|
- WHY.txt
|
52
51
|
- bin/wd
|
data/TODO.txt
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
- if someone specifies :project in a config repo block in a localized config (say a RAILS app), then use that for determining which project to use when loading the config repo
|
2
|
-
|
3
|
-
- batch deployments (--batch=/etc/deploy/hourly.yml)
|
4
|
-
- could have this simply pointing to a single yaml file with project name, target name, check value (default = true) (business value: only need one command, or one cron, to manage all of these)
|
5
|
-
- could be a directory of individual yaml files with that information in each of them (representing one project, one target) (business value: puppet/chef could more easily manage directories of files)
|
6
|
-
- trying to avoid re-using the deploy.yml because we may want to not auto-deploy all things that we have configurations for, or we may want to auto-deploy them at different frequencies
|
7
|
-
- do we want the config path to be in the meta file, or do we want that to come as part of the arguments to the deployment?
|
8
|
-
|
9
|
-
wd deploy --batch=/etc/deploy/hourly.yml --path=/etc/deploy/projects/
|
10
|
-
wd deploy --batch=/etc/deploy/hourly/ --path=/etc/deploy/projects/
|
11
|
-
wd deploy --batch=/etc/deploy/hourly.yml --path=/etc/deploy/deploy.yml
|
12
|
-
wd deploy --batch=/etc/deploy/hourly --path=/etc/deploy/projects/deploy.yml
|
13
|
-
|
14
|
-
- allow whiskey_disk to pull configuration file from an url (which would be based on project, environment)
|
15
|
-
|
16
|
-
- do git-deploy style change detection:
|
17
|
-
- get the current branch ref, then do the fetch/reset, get the current branch ref; find the differences, make them available to the rake task(s)
|
18
|
-
we can use the ml/cl part of staleness checking to get the "before" versions of the main and config repos (i.e., leave that part in always, just not the conditional stuff), and have the main run a script which dumps the relative paths of changed files as a .whiskey_disk-paths-changed in the main checkout
|
19
|
-
|
20
|
-
- some sort of simple API to access the detected changes:
|
21
|
-
require 'whiskey_disk/rake'
|
22
|
-
|
23
|
-
namespace :deploy do
|
24
|
-
task :post_deploy do
|
25
|
-
if changed_in?('db/migrate') or changed?('config/database.yml')
|
26
|
-
Rake::Task['db:migrate'].invoke
|
27
|
-
end
|
28
|
-
# etc. ...
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
- [Q] what about maintenance pages(?) (i.e., do we need a pre-deploy hook?; also are these per-target config stuffs?; fun managing changes to a maintenance page ;-)
|
33
|
-
- [Q] do we want a mechanism to manage the config repo? (add a repo, add a project, add an environment, put a file into the config repo for an environment?)
|
34
|
-
- [Q] what about per-target rake tasks, do we just store these in the config repo? does this work?
|
35
|
-
- [Q] do we need actual support for "rollbacks"?
|
36
|
-
- [Q] do we want to support multi-system deployments (i.e., deploy and rollback on 4 simultaneous app servers, other bullshit running on the db server, etc.)? If we get into this, we have the original :role problem that cap faced -- i.e., we only want to run the database operations on certain hosts.
|