ktheory-vlad 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +24 -0
- data/History.txt +173 -0
- data/Manifest.txt +25 -0
- data/PATCHES.txt +27 -0
- data/README.txt +78 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/considerations.txt +91 -0
- data/doco/deploying-merb-with-vlad.txt +155 -0
- data/doco/deploying-sinatra-with-vlad.txt +119 -0
- data/doco/faq.txt +131 -0
- data/doco/getting_started.txt +61 -0
- data/doco/migration.txt +43 -0
- data/doco/perforce.txt +5 -0
- data/doco/variables.txt +79 -0
- data/ktheory-vlad.gemspec +98 -0
- data/lib/rake_remote_task.rb +600 -0
- data/lib/vlad.rb +91 -0
- data/lib/vlad/apache.rb +37 -0
- data/lib/vlad/core.rb +191 -0
- data/lib/vlad/darcs.rb +24 -0
- data/lib/vlad/git.rb +86 -0
- data/lib/vlad/god.rb +23 -0
- data/lib/vlad/lighttpd.rb +85 -0
- data/lib/vlad/maintenance.rb +20 -0
- data/lib/vlad/merb.rb +51 -0
- data/lib/vlad/mercurial.rb +37 -0
- data/lib/vlad/mongrel.rb +62 -0
- data/lib/vlad/nginx.rb +48 -0
- data/lib/vlad/passenger.rb +8 -0
- data/lib/vlad/perforce.rb +117 -0
- data/lib/vlad/subversion.rb +35 -0
- data/lib/vlad/thin.rb +63 -0
- data/lib/vlad_test_case.rb +73 -0
- data/test/test_rake_remote_task.rb +279 -0
- data/test/test_vlad.rb +210 -0
- data/test/test_vlad_git.rb +65 -0
- data/test/test_vlad_mercurial.rb +31 -0
- data/test/test_vlad_perforce.rb +37 -0
- data/test/test_vlad_subversion.rb +27 -0
- data/vladdemo.sh +97 -0
- metadata +134 -0
data/.autotest
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'autotest/restart'
|
4
|
+
|
5
|
+
Autotest.add_hook :initialize do |at|
|
6
|
+
at.testlib = "minitest/autorun"
|
7
|
+
# at.extra_files << "../some/external/dependency.rb"
|
8
|
+
#
|
9
|
+
# at.libs << ":../some/external"
|
10
|
+
#
|
11
|
+
# at.add_exception 'vendor'
|
12
|
+
#
|
13
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
14
|
+
# at.files_matching(/test_.*rb$/)
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# %w(TestA TestB).each do |klass|
|
18
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
19
|
+
# end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Autotest.add_hook :run_command do |at|
|
23
|
+
# system "rake build"
|
24
|
+
# end
|
data/History.txt
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
=== 2.0.0 / 2009-08-18
|
2
|
+
|
3
|
+
* 1 major enhancement:
|
4
|
+
|
5
|
+
* Removed all extra modules that we don't support in core anymore.
|
6
|
+
|
7
|
+
* 2 minor enhancements:
|
8
|
+
|
9
|
+
* Added test to show that false is a valid variable value.
|
10
|
+
* Moved vlad_test_case from test to lib to support 3rd party vlad modules.
|
11
|
+
|
12
|
+
=== 1.4.0 / 2009-06-23
|
13
|
+
|
14
|
+
* 1 major enhancement:
|
15
|
+
|
16
|
+
* Switched to passenger as default app server.
|
17
|
+
|
18
|
+
* 11 minor enhancements:
|
19
|
+
|
20
|
+
* #rsync now takes ANY number of arguments and expects to you add "host:".
|
21
|
+
* Added Rake::RemoteTask#get.
|
22
|
+
* Added doco for why we don't ship a deploy task
|
23
|
+
* Added links to example maintenance recipes
|
24
|
+
* Added multi-env doco to getting_started.txt
|
25
|
+
* Added svn-over-ssh faq item. gah.
|
26
|
+
* Flipped tests to minitest
|
27
|
+
* Merged global #role and Rake::RemoteTask::role.
|
28
|
+
* Moved all global methods to Rake::RemoteTask and wrote #external to clean up.
|
29
|
+
* Moved rake extensions to hoe so everyone can enjoy the fun.
|
30
|
+
* put names the tempfile based on the remote path to ease debugging
|
31
|
+
|
32
|
+
* 2 bug fixes:
|
33
|
+
|
34
|
+
* passenger:start_app wasn't using the latest_release path
|
35
|
+
* set/fetch wasn't dealing with a default of false well. (Seth Falcon)
|
36
|
+
|
37
|
+
=== 1.3.2 / 2009-03-16
|
38
|
+
|
39
|
+
* 3 minor enhancements:
|
40
|
+
|
41
|
+
* Added 'Deploying Merb with Vlad' by Graham Ashton.
|
42
|
+
* Added 'Deploying Sinatra with Vlad' by Graham Ashton.
|
43
|
+
* Core update task calls update with the actual revision once again
|
44
|
+
|
45
|
+
* 1 bug fix:
|
46
|
+
|
47
|
+
* Fix Git checkout/export methods. (Wilson)
|
48
|
+
|
49
|
+
=== 1.3.1 / 2009-03-06
|
50
|
+
|
51
|
+
* 4 minor enhancements:
|
52
|
+
|
53
|
+
* Added faq on how to clear/replace tasks. (mikehale)
|
54
|
+
* Added sudo_prompt variable.
|
55
|
+
* Added top level sudo method to compliment run. (woahdae)
|
56
|
+
* Set sudo_flags to default to ['-p Password:']. (mly)
|
57
|
+
|
58
|
+
* 3 bug fixes:
|
59
|
+
|
60
|
+
* Fixed prompts during rollback. (goodieboy)
|
61
|
+
* deploy_via went AWOL in subversion module.
|
62
|
+
* vlad:migrate ignored migrate_target directory. (tomklaasen)
|
63
|
+
|
64
|
+
=== 1.3.0 / 2009-03-04
|
65
|
+
|
66
|
+
* 9 major enhancements:
|
67
|
+
|
68
|
+
* Added darcs support. (Brian Palmer)
|
69
|
+
* Added git support. (Garry Dolley)
|
70
|
+
* Added lighttpd support.
|
71
|
+
* Added merb support. (Jamie Macey)
|
72
|
+
* Added passenger support. (Alan Harper)
|
73
|
+
* Added/merged god, nginx, thin, and maintenance tasks. (github clusterfuck)
|
74
|
+
* Allow set to specify that a proc value is :per_thread.
|
75
|
+
* Apply Mercurial SCM support patch. Closes ticket 13475
|
76
|
+
* remote_task now supports args and supplies task (by Daniel P. Kionka).
|
77
|
+
|
78
|
+
* 19 minor enhancements:
|
79
|
+
|
80
|
+
* Add role toplevel method similar to namespace.
|
81
|
+
* Added #put method that wraps up Tempfile/rsync pattern.
|
82
|
+
* Added #role toplevel method, similar to #namespace.
|
83
|
+
* Added FAQ for using vlad through a gateway.
|
84
|
+
* Added Phil Hagelburg's one-line multi-stage deployment patch
|
85
|
+
* Added rake tracing for rsync command.
|
86
|
+
* Added umask variable.
|
87
|
+
* Adds specific order to loading. Should fix a number of bugs.
|
88
|
+
* Extended vladdemo.sh to allow for N simulated hosts (mostly for testing)
|
89
|
+
* Fixed tempfile dependency in #put if you don't load lighttpd or perforce (yipstar)
|
90
|
+
* Mercurial now automatically initializes the repository. (Jamie Macey)
|
91
|
+
* Moved everything over to put.
|
92
|
+
* Now requires rake 0.8.1+.
|
93
|
+
* Parameterized 'head' into 'revision' variable (with head as default).
|
94
|
+
* Split shared symlink creation to a separate task. (Steve Purcell)
|
95
|
+
* Support rake 0.8.
|
96
|
+
* Switched to ThreadGroup for Action#execute
|
97
|
+
* Updated rakefile for new hoe abilities
|
98
|
+
* remote_task :role now allows an empty list of hosts.
|
99
|
+
|
100
|
+
* 11 bug fixes:
|
101
|
+
|
102
|
+
* Fixed vladdemo.rb, now uses my checkout for further stress testing.
|
103
|
+
* Moved core recipe to front. Was breaking mongrel setup.
|
104
|
+
* Added automatic client setup for perforce.
|
105
|
+
* Fix mercurial support.
|
106
|
+
* Fixed 'too many files' error.
|
107
|
+
* Fixed a lame warning in the tests.
|
108
|
+
* Fixed cleanup to actually properly clean up.
|
109
|
+
* Fixed rake var doco
|
110
|
+
* Moved generic app setup to core from mongrel.
|
111
|
+
* SSH flags are now an Array for proper inclusion in the command. (Guillaume Pierronnet)
|
112
|
+
* git archive now specifically specifies tar format. (knaveofdiamonds)
|
113
|
+
|
114
|
+
=== 1.1.1 / 2008-01-14
|
115
|
+
|
116
|
+
* 5 major enhancements:
|
117
|
+
|
118
|
+
* Support for Rake 0.8. Should still work for Rake 0.7.
|
119
|
+
* Added git support (contributed by Garry Dolley).
|
120
|
+
* Reviewed for accuracy by Evan Phoenix.
|
121
|
+
* Added lighttpd.rb
|
122
|
+
* Added automatic client setup for perforce.
|
123
|
+
* Added mercurial SCM support patch. Closes ticket 13475.
|
124
|
+
|
125
|
+
* 6 minor enhancements:
|
126
|
+
|
127
|
+
* Added #put method that wraps up Tempfile/rsync pattern.
|
128
|
+
* Added automatic p4 client setup for perforce.
|
129
|
+
* Added vladdemo.sh
|
130
|
+
* Moved everything over to put.
|
131
|
+
* Moved generic app setup to core from mongrel.
|
132
|
+
* Parameterized 'head' into 'revision' variable (with head as default).
|
133
|
+
|
134
|
+
* 1 bug fix
|
135
|
+
|
136
|
+
* Fixed cleanup to actually properly clean up.
|
137
|
+
|
138
|
+
=== 1.1.0 / 2007-09-12
|
139
|
+
|
140
|
+
* 3 major enhancements:
|
141
|
+
|
142
|
+
* Vlad.load now takes a hash of recipe overrides, eg: Vlad.load :web => :nginx.
|
143
|
+
See rdoc for defaults.
|
144
|
+
* Removed vlad_tasks.rb and split into vlad/apache.rb, vlad/mongrel.rb,
|
145
|
+
and vlad/core.rb.
|
146
|
+
* The flog ratio between capistrano+deps / vlad+deps is pi (or, damn close)!
|
147
|
+
|
148
|
+
* 12 minor enhancements:
|
149
|
+
|
150
|
+
* Added $TRACE to make it more available and cleaner to read.
|
151
|
+
* Added :svn_cmd variable.
|
152
|
+
* Added Rake.clear_tasks *str_or_regexp
|
153
|
+
* Added debug and mana_from_heaven tasks to Rakefile.
|
154
|
+
* Added more documentation.
|
155
|
+
* Added :rsync_cmd and :rsync_flags.
|
156
|
+
* Added :ssh_cmd and :ssh_flags.
|
157
|
+
* Added variable expansion to vlad:debug task.
|
158
|
+
* Removed :scm variable. Now a Vlad.load component/flavor/need-a-word-here.
|
159
|
+
* Removed :application var. Use it if you want it. We don't require it.
|
160
|
+
* Renamed :p4cmd to :p4_cmd.
|
161
|
+
* Renamed :rake var to :rake_cmd.
|
162
|
+
|
163
|
+
* 2 (important) bug fixes:
|
164
|
+
|
165
|
+
* HUGE: Fixed sudo hang bug #13072. Fix suggested by Chris Van Pelt.
|
166
|
+
* HUGE: Vlad.load calls user config last, allowing variable overrides.
|
167
|
+
ACK! Sorry!
|
168
|
+
|
169
|
+
=== 1.0.0 / 2007-08-04
|
170
|
+
|
171
|
+
* 1 major enhancement
|
172
|
+
|
173
|
+
* Birthday!
|
data/Manifest.txt
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
.autotest
|
2
|
+
History.txt
|
3
|
+
Manifest.txt
|
4
|
+
README.txt
|
5
|
+
Rakefile
|
6
|
+
considerations.txt
|
7
|
+
doco/deploying-merb-with-vlad.txt
|
8
|
+
doco/deploying-sinatra-with-vlad.txt
|
9
|
+
doco/faq.txt
|
10
|
+
doco/getting_started.txt
|
11
|
+
doco/migration.txt
|
12
|
+
doco/perforce.txt
|
13
|
+
doco/variables.txt
|
14
|
+
lib/rake_remote_task.rb
|
15
|
+
lib/vlad.rb
|
16
|
+
lib/vlad/apache.rb
|
17
|
+
lib/vlad/core.rb
|
18
|
+
lib/vlad/maintenance.rb
|
19
|
+
lib/vlad/passenger.rb
|
20
|
+
lib/vlad/subversion.rb
|
21
|
+
lib/vlad_test_case.rb
|
22
|
+
test/test_rake_remote_task.rb
|
23
|
+
test/test_vlad.rb
|
24
|
+
test/test_vlad_subversion.rb
|
25
|
+
vladdemo.sh
|
data/PATCHES.txt
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
This file outlines how ktheory-vlad (http://github.com/ktheory/vlad) differs
|
2
|
+
from seattlerb's vlad (http://hitsquad.rubyforge.org/vlad/) and vlad-git
|
3
|
+
(http://github.com/jbarnette/vlad-git)
|
4
|
+
|
5
|
+
Changes from vlad-2.0 (http://hitsquad.rubyforge.org/vlad/):
|
6
|
+
|
7
|
+
* Include modules from vlad-1.4 that were removed in vlad-2.0.
|
8
|
+
In 2.0, seattlerb chose to remove modules for common web servers and SCMs
|
9
|
+
except apache, passenger, and subversion (vlad's defaults). The removed
|
10
|
+
modules must be installed seperately, but are difficult to find. See commit
|
11
|
+
a2b92b4ffdfb8748898289de96d8b84860122468
|
12
|
+
|
13
|
+
* Fix vlad:start_app passenger task when run without a full deployment.
|
14
|
+
See http://rubyforge.org/tracker/index.php?func=detail&aid=26003&group_id=4213&atid=16258
|
15
|
+
and commit 82dccf88de1561369ef5089151a58345a236e2c9
|
16
|
+
|
17
|
+
* Added the ability to prefix output with hostnames (or a custom string).
|
18
|
+
See http://rubyforge.org/tracker/index.php?func=detail&aid=20768&group_id=4213&atid=16261
|
19
|
+
and commit 7b6522df086f5e1c28d585483b9c74eb1fa660e5
|
20
|
+
|
21
|
+
Changes from vlad-git-2.1.0 (http://github.com/jbarnette/vlad-git):
|
22
|
+
|
23
|
+
* Use fast checkouts when possible insteading cloning the entire repo. (This
|
24
|
+
is an unreleased feature of vlad-git) See http://github.com/jbarnette/vlad-git/commit/749ab8f9bb7c24baafdd513a5b9d8246fc0a7f5a
|
25
|
+
|
26
|
+
* Fixes submodule initializes for git version < 1.5.6. See commit
|
27
|
+
44ff0ef446560d4a8e193877d2b9f1c46c583b21
|
data/README.txt
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
= Vlad the Deployer by the Ruby Hit Squad
|
2
|
+
|
3
|
+
* http://rubyhitsquad.com/
|
4
|
+
* http://rubyforge.org/projects/hitsquad/
|
5
|
+
|
6
|
+
== DESCRIPTION
|
7
|
+
|
8
|
+
Vlad the Deployer is pragmatic application deployment automation,
|
9
|
+
without mercy. Much like Capistrano, but with 1/10th the
|
10
|
+
complexity. Vlad integrates seamlessly with Rake, and uses familiar
|
11
|
+
and standard tools like ssh and rsync.
|
12
|
+
|
13
|
+
Impale your application on the heartless spike of the Deployer.
|
14
|
+
|
15
|
+
== FEATURES/PROBLEMS
|
16
|
+
|
17
|
+
* Full deployment automation stack.
|
18
|
+
* Turnkey deployment for mongrel+apache+svn.
|
19
|
+
* Supports single server deployment with just 3 variables defined.
|
20
|
+
* Built on rake. Easy. Engine is small.
|
21
|
+
* Very few dependencies. All simple.
|
22
|
+
* Uses ssh with your ssh settings already in place.
|
23
|
+
* Uses rsync for efficient transfers.
|
24
|
+
* Run remote commands on one or more servers.
|
25
|
+
* Mix and match local and remote tasks.
|
26
|
+
* Compatible with all of your tab completion shell script rake-tastic goodness.
|
27
|
+
* Ships with tests that actually pass in 0.028 seconds!
|
28
|
+
* Does NOT support Windows right now (we think). Coming soon in 1.2.
|
29
|
+
|
30
|
+
== SYNOPSIS
|
31
|
+
|
32
|
+
% rake vlad:setup # first time only
|
33
|
+
% rake vlad:update
|
34
|
+
% rake vlad:migrate # optional
|
35
|
+
% rake vlad:start
|
36
|
+
|
37
|
+
== REQUIREMENTS
|
38
|
+
|
39
|
+
* Rake
|
40
|
+
* Hoe
|
41
|
+
* Rubyforge
|
42
|
+
* open4
|
43
|
+
|
44
|
+
== INSTALL
|
45
|
+
|
46
|
+
* sudo gem install vlad
|
47
|
+
|
48
|
+
== SPECIAL THANKS
|
49
|
+
|
50
|
+
* First, of course, to Capistrano. For coming up with the idea and
|
51
|
+
providing a lot of meat for the recipes.
|
52
|
+
* Scott Baron for coming up with one of the best project names evar.
|
53
|
+
* Bradley Taylor for giving us permission to use RailsMachine recipes sans-LGPL.
|
54
|
+
|
55
|
+
== LICENSE
|
56
|
+
|
57
|
+
(The MIT License)
|
58
|
+
|
59
|
+
Copyright (c) 2007-2009 Ryan Davis and the rest of the Ruby Hit Squad
|
60
|
+
|
61
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
62
|
+
a copy of this software and associated documentation files (the
|
63
|
+
'Software'), to deal in the Software without restriction, including
|
64
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
65
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
66
|
+
permit persons to whom the Software is furnished to do so, subject to
|
67
|
+
the following conditions:
|
68
|
+
|
69
|
+
The above copyright notice and this permission notice shall be
|
70
|
+
included in all copies or substantial portions of the Software.
|
71
|
+
|
72
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
73
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
74
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
75
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
76
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
77
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
78
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake/testtask'
|
5
|
+
Rake::TestTask.new do |t|
|
6
|
+
t.libs << "test"
|
7
|
+
t.test_files = FileList['test/test*.rb']
|
8
|
+
t.verbose = true
|
9
|
+
end
|
10
|
+
task :default => :test
|
11
|
+
|
12
|
+
begin
|
13
|
+
require 'jeweler'
|
14
|
+
Jeweler::Tasks.new do |gemspec|
|
15
|
+
gemspec.name = "ktheory-vlad"
|
16
|
+
gemspec.summary = "Vlad the Deployer is pragmatic application deployment automation, without mercy [ktheory's fork]"
|
17
|
+
gemspec.description = %Q{
|
18
|
+
Vlad the Deployer is pragmatic application deployment automation,
|
19
|
+
without mercy. Much like Capistrano, but with 1/10th the
|
20
|
+
complexity. Vlad integrates seamlessly with Rake, and uses familiar
|
21
|
+
and standard tools like ssh and rsync. This is a fork of vlad maintained by
|
22
|
+
Aaron Suggs. See PATCHES.txt for more info""
|
23
|
+
}
|
24
|
+
gemspec.homepage = "http://github.com/ktheory/vlad"
|
25
|
+
gemspec.authors = ['Ryan Davis','Eric Hodel', 'Wilson Bilkovich', 'Aaron Suggs']
|
26
|
+
gemspec.email = ['ryand-ruby@zenspider.com', 'drbrain@segment7.net', 'wilson@supremetyrant.com', 'aaron@ktheory.com']
|
27
|
+
gemspec.add_dependency 'rake', '~> 0.8.0'
|
28
|
+
gemspec.add_dependency 'open4', '~> 0.9.0'
|
29
|
+
end
|
30
|
+
Jeweler::GemcutterTasks.new
|
31
|
+
rescue LoadError
|
32
|
+
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "quick little hack to see what the state of the nation looks like"
|
36
|
+
task :debug do
|
37
|
+
Vlad.load :config => "lib/vlad/subversion.rb"
|
38
|
+
set :repository, "repository path"
|
39
|
+
set :deploy_to, "deploy path"
|
40
|
+
set :domain, "server domain"
|
41
|
+
|
42
|
+
Rake::Task['vlad:debug'].invoke
|
43
|
+
end
|
44
|
+
|
45
|
+
task :mana_from_heaven do
|
46
|
+
# vlad = vlad + rake + open4
|
47
|
+
# rake sans-contrib = 2035.98356718206
|
48
|
+
vlad = `flog -s lib`.to_f + 2350.30744806517 + 502.363818023761
|
49
|
+
cap = 11480.3919695285
|
50
|
+
ratio = cap / vlad
|
51
|
+
target = cap / Math::PI
|
52
|
+
|
53
|
+
puts "%14.8f = %s" % [vlad, "vlad"]
|
54
|
+
puts "%14.8f = %s" % [ratio, "ratio"]
|
55
|
+
puts "%14.8f = %s" % [target - vlad, "needed delta"]
|
56
|
+
end
|
57
|
+
|
58
|
+
# vim: syntax=ruby
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|
data/considerations.txt
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
* might we want per connection values?
|
2
|
+
|
3
|
+
* :except => {:no_release => true}
|
4
|
+
|
5
|
+
It is common to configure tasks to 'announce' deployments in IRC, Campfire,
|
6
|
+
etc. If you have 6 app servers, you don't want to see 6 announcements. In
|
7
|
+
Capistrano, this is handled via the :no_release => true flag. Various tasks
|
8
|
+
only execute on the 'release' servers.
|
9
|
+
|
10
|
+
An easier way to meet this would be to introduce a :release role in the
|
11
|
+
default setup
|
12
|
+
|
13
|
+
role :release, "app1.example.com"
|
14
|
+
|
15
|
+
remote_task :announce_in_irc, :roles => :release ...
|
16
|
+
|
17
|
+
Drawback: Yet another thing to change when you migrate a project from cap to
|
18
|
+
vlad
|
19
|
+
|
20
|
+
* 'dynamic deployments'
|
21
|
+
|
22
|
+
role :app, "app1.example.com"
|
23
|
+
role :app, "app2.example.com"
|
24
|
+
|
25
|
+
Let's say that app1 and app2 need slightly different monit configurations.
|
26
|
+
|
27
|
+
In Capistrano, you might approach this by making two additional roles, and
|
28
|
+
splitting your 'push a monit config' task into two. This sucks.
|
29
|
+
|
30
|
+
Vlad makes the 'execution context' of a task available. In Vlad, you would:
|
31
|
+
|
32
|
+
remote_task :update_monit, :roles => :app
|
33
|
+
rsync "templates/#{target_host}.monitrc", "/etc/monitrc"
|
34
|
+
end
|
35
|
+
|
36
|
+
* fine-grained tasks
|
37
|
+
|
38
|
+
remote_task :update
|
39
|
+
remote_task :symlink
|
40
|
+
remote_task :migrate
|
41
|
+
remote_task :deploy => [:update, :symlink, :migrate, :restart]
|
42
|
+
|
43
|
+
Let's assume that this is a multi-server config with shared deploy path.
|
44
|
+
The user wants to do only a single checkout. If we make "update" be one big
|
45
|
+
task body that includes the update, symlink, and migrate steps,
|
46
|
+
it is difficult for the user to override the roles for the particular steps
|
47
|
+
they need to change.
|
48
|
+
|
49
|
+
If we break these into separate tasks, they can say:
|
50
|
+
|
51
|
+
Rake::Task["migrate"].options[:roles] = :master_db
|
52
|
+
|
53
|
+
and the migrations will only run on the master db
|
54
|
+
|
55
|
+
* sudo / via how? and if we call it via I will stab ppl. "user" is sufficient.
|
56
|
+
|
57
|
+
* handling 'use_sudo'
|
58
|
+
|
59
|
+
1. Check for this inside the 'run' command, and preface the command
|
60
|
+
with 'sudo' if necessary
|
61
|
+
|
62
|
+
2. Default this to 'false' in the reset method, and check for it
|
63
|
+
in the default tasks that we provide:
|
64
|
+
if use_sudo then
|
65
|
+
sudo "blah"
|
66
|
+
else
|
67
|
+
run "blah"
|
68
|
+
end
|
69
|
+
|
70
|
+
Option 2 has fewer moving parts, but clutters up the tasks that care about
|
71
|
+
this.
|
72
|
+
|
73
|
+
* Dependencies
|
74
|
+
|
75
|
+
Task dependencies aren't settable when creating a Rake::RemoteTask.
|
76
|
+
|
77
|
+
* Apache configuration
|
78
|
+
|
79
|
+
Pull in railsmachine/rails/recipes/apache.rb's apache configuration. Needs
|
80
|
+
erb to work.
|
81
|
+
|
82
|
+
* I really like tasks with naming <cmd>_<role> (eg setup_app,
|
83
|
+
start_web). We could easily make the front end remote_task command
|
84
|
+
look for such a convention and apply the :role => x automatically.
|
85
|
+
|
86
|
+
* from bousquet: get a couple of server environment recipes that prepare your
|
87
|
+
machine that would be the golden ticket:
|
88
|
+
|
89
|
+
rake vlad:prepare TYPE=accelerator | ubuntu | osx | osxserver | site5 | ...
|
90
|
+
|
91
|
+
and have people maintaining those setups who depend on them
|