felix-vlad 1.2.0.3

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.
@@ -0,0 +1,49 @@
1
+ == 1.1.1 / 2008-01-14
2
+
3
+ * 5 major enhancements:
4
+ * Support for Rake 0.8. Should still work for Rake 0.7.
5
+ * Added git support (contributed by Garry Dolley).
6
+ * Reviewed for accuracy by Evan Phoenix.
7
+ * Added lighttpd.rb
8
+ * Added automatic client setup for perforce.
9
+ * Added mercurial SCM support patch. Closes ticket 13475.
10
+ * 6 minor enhancements:
11
+ * Added #put method that wraps up Tempfile/rsync pattern.
12
+ * Added automatic p4 client setup for perforce.
13
+ * Added vladdemo.sh
14
+ * Moved everything over to put.
15
+ * Moved generic app setup to core from mongrel.
16
+ * Parameterized 'head' into 'revision' variable (with head as default).
17
+ * 1 bug fix
18
+ * Fixed cleanup to actually properly clean up.
19
+
20
+ == 1.1.0 / 2007-09-12
21
+
22
+ * 3 major enhancements:
23
+ * Vlad.load now takes a hash of recipe overrides, eg: Vlad.load :web => :nginx.
24
+ See rdoc for defaults.
25
+ * Removed vlad_tasks.rb and split into vlad/apache.rb, vlad/mongrel.rb,
26
+ and vlad/core.rb.
27
+ * The flog ratio between capistrano+deps / vlad+deps is pi (or, damn close)!
28
+ * 12 minor enhancements:
29
+ * Added $TRACE to make it more available and cleaner to read.
30
+ * Added :svn_cmd variable.
31
+ * Added Rake.clear_tasks *str_or_regexp
32
+ * Added debug and mana_from_heaven tasks to Rakefile.
33
+ * Added more documentation.
34
+ * Added :rsync_cmd and :rsync_flags.
35
+ * Added :ssh_cmd and :ssh_flags.
36
+ * Added variable expansion to vlad:debug task.
37
+ * Removed :scm variable. Now a Vlad.load component/flavor/need-a-word-here.
38
+ * Removed :application var. Use it if you want it. We don't require it.
39
+ * Renamed :p4cmd to :p4_cmd.
40
+ * Renamed :rake var to :rake_cmd.
41
+ * 2 (important) bug fixes:
42
+ * HUGE: Fixed sudo hang bug #13072. Fix suggested by Chris Van Pelt.
43
+ * HUGE: Vlad.load calls user config last, allowing variable overrides.
44
+ ACK! Sorry!
45
+
46
+ == 1.0.0 / 2007-08-04
47
+
48
+ * 1 major enhancement
49
+ * Birthday!
@@ -0,0 +1,31 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ considerations.txt
6
+ doco/faq.txt
7
+ doco/getting_started.txt
8
+ doco/migration.txt
9
+ doco/perforce.txt
10
+ doco/variables.txt
11
+ lib/rake_remote_task.rb
12
+ lib/vlad.rb
13
+ lib/vlad/apache.rb
14
+ lib/vlad/core.rb
15
+ lib/vlad/git.rb
16
+ lib/vlad/lighttpd.rb
17
+ lib/vlad/maintenance.rb
18
+ lib/vlad/mercurial.rb
19
+ lib/vlad/mongrel.rb
20
+ lib/vlad/merb.rb
21
+ lib/vlad/merb.god.rb
22
+ lib/vlad/perforce.rb
23
+ lib/vlad/subversion.rb
24
+ test/test_rake_remote_task.rb
25
+ test/test_vlad.rb
26
+ test/test_vlad_git.rb
27
+ test/test_vlad_mercurial.rb
28
+ test/test_vlad_perforce.rb
29
+ test/test_vlad_subversion.rb
30
+ test/vlad_test_case.rb
31
+ vladdemo.sh
@@ -0,0 +1,78 @@
1
+ Vlad the Deployer
2
+ by the Ruby Hit Squad
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 -y 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 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.
@@ -0,0 +1,51 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+ $: << 'lib'
6
+ require 'vlad'
7
+
8
+ Hoe.new('vlad', Vlad::VERSION) do |p|
9
+ p.rubyforge_name = 'hitsquad'
10
+ p.author = ["Ryan Davis", "Eric Hodel", "Wilson Bilkovich"]
11
+ p.email = "ryand-ruby@zenspider.com"
12
+ p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/).map { |s| s.strip }[2..-1]
13
+ p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
14
+ p.summary = p.paragraphs_of('README.txt', 2).join
15
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
16
+ p.extra_deps << 'rake'
17
+ p.extra_deps << 'open4'
18
+ end
19
+
20
+ desc "quick little hack to see what the state of the nation looks like"
21
+ task :debug do
22
+ Vlad.load :config => "lib/vlad/subversion.rb"
23
+ set :code_repo, "code repo path"
24
+ set :deploy_to, "deploy path"
25
+ set :domain, "server domain"
26
+
27
+ Rake::Task['vlad:debug'].invoke
28
+ end
29
+
30
+ task :flog do
31
+ sh 'flog -s lib'
32
+ end
33
+
34
+ task :flog_full do
35
+ sh 'flog -a lib'
36
+ end
37
+
38
+ task :mana_from_heaven do
39
+ # vlad = vlad + rake + open4
40
+ # rake sans-contrib = 2035.98356718206
41
+ vlad = `flog -s lib`.to_f + 2350.30744806517 + 502.363818023761
42
+ cap = 11480.3919695285
43
+ ratio = cap / vlad
44
+ target = cap / Math::PI
45
+
46
+ puts "%14.8f = %s" % [vlad, "vlad"]
47
+ puts "%14.8f = %s" % [ratio, "ratio"]
48
+ puts "%14.8f = %s" % [target - vlad, "needed delta"]
49
+ end
50
+
51
+ # vim: syntax=Ruby
@@ -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
@@ -0,0 +1,75 @@
1
+ == Rake & Recipes
2
+
3
+ === Q: Why is there no vlad:restart?
4
+ === A: It is cleaner!
5
+
6
+ We don't want to have to think about what state we're in and where. So vlad:start does a restart if necessary. Restart is just "start again" after all... That is what start does.
7
+
8
+ === Q: Why are there no before_action and after_action hooks?
9
+ === A: Because we use rake!
10
+
11
+ Rake don't need no stinkin' hooks! They're too clever. Last I checked before_after_before_start worked in cap... how? why? I dunno...
12
+
13
+ To extend a task (adding something after), just define it again:
14
+
15
+ task :action1 do
16
+ puts "one fish, two fish"
17
+ end
18
+
19
+ task :action1 do
20
+ puts "red fish, blue fish"
21
+ end
22
+
23
+ To prepend on a task, add a dependency:
24
+
25
+ task :action2 do
26
+ puts "red fish, blue fish"
27
+ end
28
+
29
+ task :myaction do
30
+ puts "one fish, two fish"
31
+ end
32
+
33
+ task :action2 => :myaction
34
+
35
+ === Q: How do I invoke another rule?
36
+ === A: The easiest way is via dependencies.
37
+
38
+ task :shazam! => [:action1, :action2]
39
+
40
+ The other way is to look it up and call invoke:
41
+
42
+ task :shazam! do
43
+ Rake::Task[:action1].invoke
44
+ Rake::Task[:action2].invoke
45
+ end
46
+
47
+ (Or, cheat and call out to rake again: sh "rake action1")
48
+
49
+ == Using SSH
50
+
51
+ === Q: Is there any way to set the ssh user?
52
+ === A: Yes, using ~/.ssh/config
53
+
54
+ Host example.com
55
+ User fluffy_bunny
56
+
57
+ OR: Alternatively, you can do this within your recipes like so:
58
+
59
+ set :user, "fluffy_bunny"
60
+ set :domain, "#{user}@example.com"
61
+
62
+ === Q: Is there any way to speed up ssh connections?
63
+ === A: Yes, add to your Host entry in ~/.ssh/config:
64
+
65
+ ControlMaster auto
66
+ ControlPath ~/.ssh/master-%r@%h:%p
67
+
68
+ === Q: I'm tired of typing in my password!
69
+ === A: Me too!
70
+
71
+ Put a password on your key, distribute your public key to the server and then use ssh-agent.
72
+
73
+ Check out this tiny tutorial at LBL: A brief ssh-agent tutorial <http://upc.lbl.gov/docs/user/sshagent.html>
74
+
75
+ If you're on a mac, use SSHKeychain, we love it. <http://www.sshkeychain.org/>
@@ -0,0 +1,41 @@
1
+
2
+ == Quick Start for a 1-Server Solution:
3
+
4
+ === Setup
5
+
6
+ * Create a deploy file, usually in "config/deploy.rb":
7
+
8
+ set :application, "project"
9
+ set :domain, "example.com"
10
+ set :deploy_to, "/path/to/install"
11
+ set :code_repo, 'http://svn.example.com/project/branches/stable/'
12
+
13
+ This defaults to using 'svn export' from +code_repo+, and a single
14
+ server for +app+, +db+, and +www+. If you need to tweak these things,
15
+ refer to the variable documentation.
16
+
17
+ * Add the following to your Rakefile:
18
+
19
+ begin
20
+ require 'vlad'
21
+ Vlad.load
22
+ rescue LoadError
23
+ # do nothing
24
+ end
25
+
26
+ Vlad.load has a lot of flexibility. See the rdoc for full information.
27
+
28
+ You don't need the begin/rescue/end block if you ensure that Vlad is
29
+ installed on all your servers. To be lazy, you can install vlad via:
30
+
31
+ % rake vlad:invoke COMMAND='sudo gem install vlad -y'
32
+
33
+ === Initial Launch
34
+
35
+ * Run <tt>rake vlad:setup vlad:update vlad:migrate vlad:start</tt>
36
+
37
+ === Subsequent Updates:
38
+
39
+ * <tt>rake vlad:update vlad:migrate vlad:start</tt>
40
+
41
+ Each step may be run separately.
@@ -0,0 +1,43 @@
1
+ == Converting from Capistrano
2
+
3
+ * 'set scm' is removed. Vlad.load :scm => :something if you don't use subversion.
4
+ * 'task' blocks are renamed to 'remote_task'.
5
+ * Most variables are the same. See variables.txt for details.
6
+ * No +with_command+ / +sudo+ / +via+ wonkiness
7
+ * Uses real ssh so env vars and the like are not a problem
8
+ - no +with_env+ as a result.
9
+ * Vlad doesn't use ':no_release' or ':primary'.
10
+ - If you have a task that needs to run on only one host from a role,
11
+ you should declare a new role for that host:
12
+
13
+ role :master_db, "master.example.com"
14
+
15
+ ..and then override the role for the task you want to limit:
16
+
17
+ Rake::Task["mytask"].options[:roles] = :master_db
18
+
19
+ * The 'host' method can be used to consolidate multiple 'role' calls.
20
+ - host "www.example.com", :app, :web, :db
21
+ specifies a host with three roles.
22
+ * migrate_env is now migrate_args.
23
+ * Vlad doesn't have before/after magic add-on tasks.
24
+
25
+ == BEFORE:
26
+
27
+ set :application, "rubyholic"
28
+ set :domain, "zenspider.textdriven.com"
29
+ set :repository, "svn://svn.example.com/rubyholic/branches/stable"
30
+ set :deploy_to, "/users/home/zenspider/domains/new.rubyholic.com"
31
+
32
+ set :user, "zenspider"
33
+ set :use_sudo, false
34
+
35
+ role :web, domain
36
+ role :app, domain
37
+ role :db, domain, :primary => true
38
+
39
+ == AFTER:
40
+
41
+ set :domain, "zenspider.textdriven.com"
42
+ set :code_repo, "svn://svn.example.com/rubyholic/branches/stable"
43
+ set :deploy_to, "/users/home/zenspider/domains/new.rubyholic.com"