capistrano-rsync-bladrak 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91d13719c39d21f7f01ebc3851b024eb863c4f24
4
- data.tar.gz: c9767794b929c4c6b5840514c96923f78dfb2eec
3
+ metadata.gz: 791363f9b4401035fac5812216e69f4ff4e22ffa
4
+ data.tar.gz: be0a78abd93cfad6ae1fe1b5dddfc545282a0f2e
5
5
  SHA512:
6
- metadata.gz: fda362c7d0ee4a8376d1b9d84384a737b81d21756298e7667c94ea22ea556dd74ac34238fe826bb48c998a31c86b1c7467617531925a9803d71ed1342a616aa4
7
- data.tar.gz: eb6c7c93fdbfd132939713b5e5ac1f427c6ada5dfb69b0b6c7362f40a4ab3362da8361d27895bbf75d040abf6f2928223b6eb95e4c0fb96a7c4353e6cf72c5df
6
+ metadata.gz: 8bb79f4dce51ef3cdbafc311240e97dc78d6284cf54ce7f285f2a6359253cd7bdf7a8db62a87fce24c17ca76e2c08a04e10b21c88c63c965424deec3810c8b75
7
+ data.tar.gz: fd13d028dd808f8379f4803578933f0caef2f6edb37195c68849e4b1508bd2e03828fc1d6a5d587a33eba0fbd981453c261cc93f720cd4cc304ac4c935c7eccc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.1.0 (Jan 17, 2015)
2
+ - Added ``:rsync_sparse_checkout`` option
3
+
1
4
  ## 1.0.3 (Jul 10, 2014)
2
5
  - Added ``set_current_revision`` task
3
6
  - Added ``:rsync_target_dir`` variable to specify the target dir in the rsync operation
data/README.md CHANGED
@@ -98,7 +98,8 @@ repo_url | `.` | The path or URL to a Git repository to clone from.
98
98
  branch | `master` | The Git branch to checkout.
99
99
  rsync_stage | `tmp/deploy` | Path where to clone your repository for staging, checkouting and rsyncing. Can be both relative or absolute.
100
100
  rsync_cache | `shared/deploy` | Path where to cache your repository on the server to avoid rsyncing from scratch each time. Can be both relative or absolute.<br> Set to `nil` if you want to disable the cache.
101
- rsync_options | `[]` | Array of options to pass to `rsync`.
101
+ rsync_options | `[]` | Array of options to pass to `rsync`.
102
+ rsync_sparse_checkout | `[]` | Array of directories to checkout (checks out all if empty)
102
103
 
103
104
 
104
105
  License
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Rsync
3
- VERSION = "1.0.6"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ namespace :load do
5
5
 
6
6
  set :rsync_options, []
7
7
  set :rsync_copy, "rsync --archive --acls --xattrs"
8
+ set :rsync_sparse_checkout, []
8
9
 
9
10
  # Stage is used on your local machine for rsyncing from.
10
11
  set :rsync_stage, "tmp/deploy"
@@ -44,8 +45,6 @@ task :rsync => %w[rsync:stage] do
44
45
  rsync << File.join(fetch(:rsync_stage), File.join(fetch(:rsync_target_dir), ""))
45
46
  rsync << "#{user}#{role.hostname}:#{rsync_cache.call || release_path}"
46
47
 
47
- puts "Executing rsync: #{rsync}"
48
-
49
48
  Kernel.system *rsync
50
49
  end
51
50
  end
@@ -68,12 +67,51 @@ namespace :rsync do
68
67
  task :create_stage do
69
68
  next if File.directory?(fetch(:rsync_stage))
70
69
 
71
- clone = %W[git clone]
72
- clone << fetch(:repo_url, ".")
73
- clone << fetch(:rsync_stage)
74
- puts "Executing rsync:create_stage: #{clone}"
70
+ if fetch(:rsync_sparse_checkout, []).any?
71
+ invoke "rsync:create_stage:sparse"
72
+ else
73
+ invoke "rsync:create_stage:clone"
74
+ end
75
+ end
76
+
77
+ namespace :create_stage do
78
+ task :sparse do
79
+ init = %W[git init]
80
+ init << fetch(:rsync_stage)
81
+
82
+ Kernel.system *init
83
+
84
+ Dir.chdir fetch(:rsync_stage) do
85
+ remote = %W[git remote add -f origin]
86
+ remote << fetch(:repo_url)
87
+ Kernel.system *remote
75
88
 
76
- Kernel.system *clone
89
+ sparse = %W[git config core.sparsecheckout true]
90
+ Kernel.system *sparse
91
+
92
+ sparse_dir = %W[mkdir .git/info]
93
+ Kernel.system *sparse_dir
94
+
95
+ fetch(:rsync_sparse_checkout).each do |sparse_dir|
96
+ sparse_checkout = %W[echo]
97
+ sparse_checkout << sparse_dir
98
+ sparse_checkout << ">>"
99
+ sparse_checkout << ".git/info/sparse-checkout"
100
+ Kernel.system *sparse_checkout
101
+ end
102
+
103
+ pull = %W[git pull origin]
104
+ pull << fetch(:rsync_stage)
105
+ Kernel.system *pull
106
+ end
107
+ end
108
+
109
+ task :clone do
110
+ clone = %W[git clone]
111
+ clone << fetch(:repo_url, ".")
112
+ clone << fetch(:rsync_stage)
113
+ Kernel.system *clone
114
+ end
77
115
  end
78
116
 
79
117
  desc "Stage the repository in a local directory."
@@ -81,11 +119,9 @@ namespace :rsync do
81
119
  Dir.chdir fetch(:rsync_stage) do
82
120
  update = %W[git fetch --quiet --all --prune]
83
121
  Kernel.system *update
84
- puts "Executing rsync:stage:update #{update}"
85
122
 
86
123
  target = !!fetch(:rsync_checkout_tag, false) ? "tags/#{fetch(:branch)}" : "origin/#{fetch(:branch)}"
87
124
  checkout = %W[git reset --hard #{target}]
88
- puts "Executing rsync:stage:checkout #{checkout}"
89
125
 
90
126
  Kernel.system *checkout
91
127
  end
@@ -97,7 +133,6 @@ namespace :rsync do
97
133
  next if !fetch(:rsync_cache)
98
134
 
99
135
  copy = %(#{fetch(:rsync_copy)} "#{rsync_cache.call}/" "#{release_path}/")
100
- puts "Executing rsync:release #{copy}"
101
136
  on roles(:all).each do execute copy end
102
137
  end
103
138
 
metadata CHANGED
@@ -1,33 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rsync-bladrak
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andri Möll, Hugo Briand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0.pre14
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '4'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.0.0.pre14
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4'
33
33
  description: "Deploy with Rsync to your server from any local (or remote) repository.
@@ -39,7 +39,7 @@ executables: []
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
- - .gitignore
42
+ - ".gitignore"
43
43
  - CHANGELOG.md
44
44
  - LICENSE
45
45
  - Makefile
@@ -57,17 +57,17 @@ require_paths:
57
57
  - lib
58
58
  required_ruby_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
69
  rubyforge_project:
70
- rubygems_version: 2.0.14
70
+ rubygems_version: 2.4.5
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Deploy with Rsync from any local (or remote) repository. Capistrano v3 ready!