capistrano-withrsync 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/capistrano/tasks/withrsync.rake +14 -14
- data/lib/capistrano/withrsync/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: 0605cbea97049b12351f082eba5848e338ec1058
|
4
|
+
data.tar.gz: 365992c2486e997d51281f9041d2f891c274e79a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7a38a7b61021b84ab8a024d0aed108400e120d13c0251d407661e9b3bdc722352e26cae6112b7f3de0749ea2a1d0e1518d3661efd5c2a171d312bcab7b6e7b5
|
7
|
+
data.tar.gz: 0237150e5894e030a2f0d425452cdd2324fb00a4d773a3a80f7a092fd9f1a363aa07b9881514ce83d33f0dc6ec5b76cd335e85334d365dfdb8b0f3803a63264c
|
data/README.md
CHANGED
@@ -56,11 +56,11 @@ Configuration
|
|
56
56
|
|
57
57
|
Set capistrano variables with `set name, value`.
|
58
58
|
|
59
|
-
|
60
|
-
-------------
|
61
|
-
|
62
|
-
|
63
|
-
rsync_options | `%w(--recursive --delete --delete-excluded --exclude .git* --exclude .svn*)` |
|
59
|
+
name | default | description
|
60
|
+
------------- | -------- | ------------
|
61
|
+
rsync_src | `tmp/deploy` | rsync src path
|
62
|
+
rsync_dest | `shared/deploy` | rsync dest path
|
63
|
+
rsync_options | `%w(--recursive --delete --delete-excluded --exclude .git* --exclude .svn*)` | rsync options
|
64
64
|
|
65
65
|
Contributing
|
66
66
|
------------
|
@@ -16,13 +16,13 @@ namespace :rsync do
|
|
16
16
|
--xattrs
|
17
17
|
)
|
18
18
|
|
19
|
-
set :
|
20
|
-
set :
|
19
|
+
set :rsync_src, 'tmp/deploy'
|
20
|
+
set :rsync_dest, 'shared/deploy'
|
21
21
|
|
22
|
-
set :
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
set :rsync_dest_fullpath, -> {
|
23
|
+
path = fetch(:rsync_dest)
|
24
|
+
path = "#{deploy_to}/#{path}" if path && path !~ /^\//
|
25
|
+
path
|
26
26
|
}
|
27
27
|
|
28
28
|
desc 'Override scm tasks'
|
@@ -50,24 +50,24 @@ namespace :rsync do
|
|
50
50
|
desc 'Create a destination for rsync on deployment hosts'
|
51
51
|
task :create_dest do
|
52
52
|
on release_roles :all do
|
53
|
-
path = File.join fetch(:deploy_to), fetch(:
|
53
|
+
path = File.join fetch(:deploy_to), fetch(:rsync_dest)
|
54
54
|
execute :mkdir, '-pv', path
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
desc 'Create a source for rsync'
|
59
59
|
task :create_src do
|
60
|
-
next if File.directory? fetch(:
|
60
|
+
next if File.directory? fetch(:rsync_src)
|
61
61
|
|
62
62
|
run_locally do
|
63
|
-
execute :git, :clone, fetch(:repo_url), fetch(:
|
63
|
+
execute :git, :clone, fetch(:repo_url), fetch(:rsync_src)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
desc 'Stage the repository in a local directory'
|
68
68
|
task stage: :'rsync:create_src' do
|
69
69
|
run_locally do
|
70
|
-
within fetch(:
|
70
|
+
within fetch(:rsync_src) do
|
71
71
|
execute :git, :fetch, '--quiet --all --prune'
|
72
72
|
execute :git, :reset, "--hard origin/#{fetch(:branch)}"
|
73
73
|
set :current_revision, "#{`git rev-parse --short HEAD`}".chomp
|
@@ -82,8 +82,8 @@ namespace :rsync do
|
|
82
82
|
run_locally do
|
83
83
|
user = "#{role.user}@" if !role.user.nil?
|
84
84
|
rsync_options = "#{fetch(:rsync_options).join(' ')}"
|
85
|
-
rsync_from = "#{fetch(:
|
86
|
-
rsync_to = "#{user}#{role.hostname}:#{fetch(:
|
85
|
+
rsync_from = "#{fetch(:rsync_src)}/"
|
86
|
+
rsync_to = "#{user}#{role.hostname}:#{fetch(:rsync_dest_fullpath) || release_path}"
|
87
87
|
|
88
88
|
unless rsync_to == last_rsync_to
|
89
89
|
execute :rsync, rsync_options, rsync_from, rsync_to
|
@@ -95,12 +95,12 @@ namespace :rsync do
|
|
95
95
|
|
96
96
|
desc 'Copy the code to the releases directory'
|
97
97
|
task release: :'rsync:sync' do
|
98
|
-
next if !fetch(:
|
98
|
+
next if !fetch(:rsync_dest)
|
99
99
|
|
100
100
|
on release_roles :all do
|
101
101
|
execute :rsync,
|
102
102
|
"#{fetch(:rsync_copy_options).join(' ')}",
|
103
|
-
"#{fetch(:
|
103
|
+
"#{fetch(:rsync_dest_fullpath)}/",
|
104
104
|
"#{release_path}/"
|
105
105
|
end
|
106
106
|
end
|