capistrano-rsync-bladrak 1.0.4 → 1.0.5
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.
- checksums.yaml +4 -4
- data/lib/capistrano/rsync.rb +29 -14
- data/lib/capistrano/rsync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4df1363d17de84c679fcf4b616f29b1562f27263
|
4
|
+
data.tar.gz: 4ea5dc3b94c0e36ecd595fcd9db11b3f5aa149d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bceb21dfa6a52c4db840fb9b38738047489e69bdec8fd1713522d5f89ab6f4a3030b95f10b4a17dd88506791b601bb8755ff82d0da3cf4a996d0fee694a23376
|
7
|
+
data.tar.gz: e28b60d7bda9eadde12418f7a1f91bf863fb6a1bcfdc3262a6c5b7019f09ea3949a123067e03e0efd6c951f849a16f6f2265e88c7bf2322ae18a32a2bc7f6b48
|
data/lib/capistrano/rsync.rb
CHANGED
@@ -1,22 +1,29 @@
|
|
1
1
|
require File.expand_path("../rsync/version", __FILE__)
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
# private API and internals of Capistrano::Rsync. If you think something should
|
6
|
-
# be public for extending and hooking, please let me know!
|
3
|
+
namespace :load do
|
4
|
+
task :defaults do
|
7
5
|
|
8
|
-
set :rsync_options, []
|
9
|
-
set :rsync_copy, "rsync --archive --acls --xattrs"
|
6
|
+
set :rsync_options, []
|
7
|
+
set :rsync_copy, "rsync --archive --acls --xattrs"
|
10
8
|
|
11
|
-
# Stage is used on your local machine for rsyncing from.
|
12
|
-
set :rsync_stage, "tmp/deploy"
|
9
|
+
# Stage is used on your local machine for rsyncing from.
|
10
|
+
set :rsync_stage, "tmp/deploy"
|
13
11
|
|
14
|
-
# Cache is used on the server to copy files to from to the release directory.
|
15
|
-
# Saves you rsyncing your whole app folder each time. If you nil rsync_cache,
|
16
|
-
# Capistrano::Rsync will sync straight to the release path.
|
17
|
-
set :rsync_cache, "shared/deploy"
|
12
|
+
# Cache is used on the server to copy files to from to the release directory.
|
13
|
+
# Saves you rsyncing your whole app folder each time. If you nil rsync_cache,
|
14
|
+
# Capistrano::Rsync will sync straight to the release path.
|
15
|
+
set :rsync_cache, "shared/deploy"
|
16
|
+
|
17
|
+
set :rsync_target_dir, ""
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
18
21
|
|
19
|
-
|
22
|
+
|
23
|
+
# NOTE: Please don't depend on tasks without a description (`desc`) as they
|
24
|
+
# might change between minor or patch version releases. They make up the
|
25
|
+
# private API and internals of Capistrano::Rsync. If you think something should
|
26
|
+
# be public for extending and hooking, please let me know!
|
20
27
|
|
21
28
|
rsync_cache = lambda do
|
22
29
|
cache = fetch(:rsync_cache)
|
@@ -25,7 +32,7 @@ rsync_cache = lambda do
|
|
25
32
|
end
|
26
33
|
|
27
34
|
Rake::Task["deploy:check"].enhance ["rsync:hook_scm"]
|
28
|
-
Rake::Task["deploy:updating"].enhance ["rsync:hook_scm"]
|
35
|
+
# Rake::Task["deploy:updating"].enhance ["rsync:hook_scm"]
|
29
36
|
|
30
37
|
desc "Stage and rsync to the server (or its cache)."
|
31
38
|
task :rsync => %w[rsync:stage] do
|
@@ -36,6 +43,8 @@ task :rsync => %w[rsync:stage] do
|
|
36
43
|
rsync.concat fetch(:rsync_options)
|
37
44
|
rsync << File.join(fetch(:rsync_stage), File.join(fetch(:rsync_target_dir), ""))
|
38
45
|
rsync << "#{user}#{role.hostname}:#{rsync_cache.call || release_path}"
|
46
|
+
|
47
|
+
puts "Executing rsync: #{rsync}"
|
39
48
|
|
40
49
|
Kernel.system *rsync
|
41
50
|
end
|
@@ -62,6 +71,8 @@ namespace :rsync do
|
|
62
71
|
clone = %W[git clone]
|
63
72
|
clone << fetch(:repo_url, ".")
|
64
73
|
clone << fetch(:rsync_stage)
|
74
|
+
puts "Executing rsync:create_stage: #{clone}"
|
75
|
+
|
65
76
|
Kernel.system *clone
|
66
77
|
end
|
67
78
|
|
@@ -70,8 +81,11 @@ namespace :rsync do
|
|
70
81
|
Dir.chdir fetch(:rsync_stage) do
|
71
82
|
update = %W[git fetch --quiet --all --prune]
|
72
83
|
Kernel.system *update
|
84
|
+
puts "Executing rsync:stage:update #{update}"
|
73
85
|
|
74
86
|
checkout = %W[git reset --hard origin/#{fetch(:branch)}]
|
87
|
+
puts "Executing rsync:stage:checkout #{checkout}"
|
88
|
+
|
75
89
|
Kernel.system *checkout
|
76
90
|
end
|
77
91
|
end
|
@@ -82,6 +96,7 @@ namespace :rsync do
|
|
82
96
|
next if !fetch(:rsync_cache)
|
83
97
|
|
84
98
|
copy = %(#{fetch(:rsync_copy)} "#{rsync_cache.call}/" "#{release_path}/")
|
99
|
+
puts "Executing rsync:release #{copy}"
|
85
100
|
on roles(:all).each do execute copy end
|
86
101
|
end
|
87
102
|
|