vlad 1.3.0 → 1.3.1
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.tar.gz.sig +2 -0
- data/History.txt +15 -0
- data/doco/faq.txt +12 -0
- data/doco/variables.txt +2 -1
- data/lib/rake_remote_task.rb +9 -3
- data/lib/vlad.rb +1 -1
- data/lib/vlad/core.rb +2 -2
- data/lib/vlad/subversion.rb +6 -5
- data/test/test_rake_remote_task.rb +1 -1
- metadata +24 -3
- metadata.gz.sig +0 -0
data.tar.gz.sig
ADDED
data/History.txt
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
== 1.3.1 / 2009-03-06
|
2
|
+
|
3
|
+
* 4 minor enhancements:
|
4
|
+
|
5
|
+
* Added faq on how to clear/replace tasks. (mikehale)
|
6
|
+
* Added sudo_prompt variable.
|
7
|
+
* Added top level sudo method to compliment run. (woahdae)
|
8
|
+
* Set sudo_flags to default to ['-p Password:']. (mly)
|
9
|
+
|
10
|
+
* 3 bug fixes:
|
11
|
+
|
12
|
+
* Fixed prompts during rollback. (goodieboy)
|
13
|
+
* deploy_via went AWOL in subversion module.
|
14
|
+
* vlad:migrate ignored migrate_target directory. (tomklaasen)
|
15
|
+
|
1
16
|
=== 1.3.0 / 2009-03-04
|
2
17
|
|
3
18
|
* 9 major enhancements:
|
data/doco/faq.txt
CHANGED
@@ -32,6 +32,18 @@ To prepend on a task, add a dependency:
|
|
32
32
|
|
33
33
|
task :action2 => :myaction
|
34
34
|
|
35
|
+
=== Q: How can I replace a rake task instead of just adding to it?
|
36
|
+
=== A: Use Rake.clear_tasks str_or_regexp
|
37
|
+
|
38
|
+
namespace :vlad do
|
39
|
+
# Clear existing update task so that we can redefine instead of adding to it.
|
40
|
+
Rake.clear_tasks('vlad:update')
|
41
|
+
|
42
|
+
remote_task :update, :roles => :app do
|
43
|
+
#custom update stuff
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
=== Q: How do I invoke another rule?
|
36
48
|
=== A: The easiest way is via dependencies.
|
37
49
|
|
data/doco/variables.txt
CHANGED
@@ -41,7 +41,8 @@ shared_path:: Full path to remote 'shared' directory, symlinked into
|
|
41
41
|
ssh_cmd:: Path to ssh. Defaults to "ssh".
|
42
42
|
ssh_flags:: Flags for ssh. Defaults to [].
|
43
43
|
sudo_cmd:: Path to sudo command. Defaults to "sudo".
|
44
|
-
sudo_flags:: Flogs for sudo. Defaults to
|
44
|
+
sudo_flags:: Flogs for sudo. Defaults to ["-p Password:"].
|
45
|
+
sudo_prompt:: Regexp for sudo password prompt. Defaults to /^Password:/.
|
45
46
|
sudo_password:: Asks for password when referenced.
|
46
47
|
umask:: Sets your umask value. Defaults to "02".
|
47
48
|
|
data/lib/rake_remote_task.rb
CHANGED
@@ -68,6 +68,11 @@ def rsync local, remote
|
|
68
68
|
Thread.current[:task].rsync local, remote
|
69
69
|
end
|
70
70
|
|
71
|
+
# run the command w/ sudo
|
72
|
+
def sudo command
|
73
|
+
Thread.current[:task].sudo(command)
|
74
|
+
end
|
75
|
+
|
71
76
|
# Declare a variable called +name+ and assign it a value. A
|
72
77
|
# globally-visible method with the name of the variable is defined.
|
73
78
|
# If a block is given, it will be called when the variable is first
|
@@ -245,7 +250,7 @@ class Rake::RemoteTask < Rake::Task
|
|
245
250
|
data = stream.readpartial(1024)
|
246
251
|
out_stream[stream].write data
|
247
252
|
|
248
|
-
if stream == err and data =~
|
253
|
+
if stream == err and data =~ sudo_prompt then
|
249
254
|
inn.puts sudo_password
|
250
255
|
data << "\n"
|
251
256
|
$stderr.write "\n"
|
@@ -473,7 +478,8 @@ class Rake::RemoteTask < Rake::Task
|
|
473
478
|
:ssh_cmd, "ssh",
|
474
479
|
:ssh_flags, [],
|
475
480
|
:sudo_cmd, "sudo",
|
476
|
-
:sudo_flags,
|
481
|
+
:sudo_flags, ['-p Password:'],
|
482
|
+
:sudo_prompt, /^Password:/,
|
477
483
|
:umask, '02')
|
478
484
|
|
479
485
|
set(:current_release) { File.join(releases_path, releases[-1]) }
|
@@ -535,7 +541,7 @@ class Rake::RemoteTask < Rake::Task
|
|
535
541
|
# Execute +command+ under sudo using run.
|
536
542
|
|
537
543
|
def sudo command
|
538
|
-
run [sudo_cmd, sudo_flags, command].compact.join(" ")
|
544
|
+
run [sudo_cmd, sudo_flags, command].flatten.compact.join(" ")
|
539
545
|
end
|
540
546
|
|
541
547
|
##
|
data/lib/vlad.rb
CHANGED
data/lib/vlad/core.rb
CHANGED
@@ -97,7 +97,7 @@ namespace :vlad do
|
|
97
97
|
else raise ArgumentError, "unknown migration target #{migrate_target.inspect}"
|
98
98
|
end
|
99
99
|
|
100
|
-
run "cd #{
|
100
|
+
run "cd #{directory}; #{rake_cmd} RAILS_ENV=#{rails_env} db:migrate #{migrate_args}"
|
101
101
|
end
|
102
102
|
|
103
103
|
desc "Invoke a single command on every remote server. This is useful for
|
@@ -153,7 +153,7 @@ namespace :vlad do
|
|
153
153
|
if releases.length < 2 then
|
154
154
|
abort "could not rollback the code because there is no prior release"
|
155
155
|
else
|
156
|
-
run "rm #{current_path}; ln -s #{previous_release} #{current_path} && rm -rf #{current_release}"
|
156
|
+
run "rm -f #{current_path}; ln -s #{previous_release} #{current_path} && rm -rf #{current_release}"
|
157
157
|
end
|
158
158
|
|
159
159
|
Rake::Task['vlad:start'].invoke
|
data/lib/vlad/subversion.rb
CHANGED
@@ -16,11 +16,12 @@ class Vlad::Subversion
|
|
16
16
|
# the directory +destination+.
|
17
17
|
|
18
18
|
def export(revision_or_source, destination)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
"#{svn_cmd} #{deploy_via} " +
|
20
|
+
if revision_or_source =~ /^(\d+|head)$/i then
|
21
|
+
"-r #{revision_or_source} #{repository} #{destination}"
|
22
|
+
else
|
23
|
+
"#{revision_or_source} #{destination}"
|
24
|
+
end
|
24
25
|
end
|
25
26
|
|
26
27
|
##
|
@@ -155,7 +155,7 @@ class TestRakeRemoteTask < VladTestCase
|
|
155
155
|
commands = @task.commands
|
156
156
|
|
157
157
|
assert_equal 1, commands.size, 'wrong number of commands'
|
158
|
-
assert_equal ["ssh", "app.example.com", "sudo ls"],
|
158
|
+
assert_equal ["ssh", "app.example.com", "sudo -p Password: ls"],
|
159
159
|
commands.first, 'app'
|
160
160
|
end
|
161
161
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vlad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -9,9 +9,30 @@ authors:
|
|
9
9
|
- Wilson Bilkovich
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
|
-
cert_chain:
|
12
|
+
cert_chain:
|
13
|
+
- |
|
14
|
+
-----BEGIN CERTIFICATE-----
|
15
|
+
MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
16
|
+
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
17
|
+
GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
|
18
|
+
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
19
|
+
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
20
|
+
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
21
|
+
taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
|
22
|
+
oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
|
23
|
+
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
24
|
+
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
25
|
+
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
26
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
27
|
+
AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
|
28
|
+
vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
|
29
|
+
w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
|
30
|
+
l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
|
31
|
+
n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
|
32
|
+
FBHgymkyj/AOSqKRIpXPhjC6
|
33
|
+
-----END CERTIFICATE-----
|
13
34
|
|
14
|
-
date: 2009-03-
|
35
|
+
date: 2009-03-06 00:00:00 -08:00
|
15
36
|
default_executable:
|
16
37
|
dependencies:
|
17
38
|
- !ruby/object:Gem::Dependency
|
metadata.gz.sig
ADDED
Binary file
|