capistrano-bundle_rsync 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +40 -3
- data/capistrano-bundle_rsync.gemspec +1 -1
- data/lib/capistrano/bundle_rsync/bundler.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a272976a4fc18a543cf265e06f8b6a3f009d9e84
|
4
|
+
data.tar.gz: 0351532a2684c6a52e840bd360c7d60893fb740b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af113b310aeb9f769ae225c430faf78dd719220be932ad5d9b1dc4ec5911a0f2f6f8a6129b9ad831f488cedf7b657dcfdf3029040a36cf7bc6412d901ce9fc0f
|
7
|
+
data.tar.gz: 9e689d2e32b55d2f1cebc2806eb710fef31930616db97f604d5d6022cd31ab36d3731091abf1555b21a8443776dd7895446a4a1fb602b3d7cde1cf80356d2a35
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -68,6 +68,7 @@ bundle_rsync_skip_bundle | false | (Secret option) Do not `bundle` and rsync bun
|
|
68
68
|
## Task Orders
|
69
69
|
|
70
70
|
```
|
71
|
+
$ cap stage deploy --trace | grep Execute
|
71
72
|
** Execute bundle_rsync:check
|
72
73
|
** Execute bundle_rsync:clone
|
73
74
|
** Execute bundle_rsync:update
|
@@ -152,7 +153,7 @@ Edit `config/deploy/localhost.rb` as followings for example:
|
|
152
153
|
```ruby
|
153
154
|
set :branch, ENV['BRANCH'] || 'master'
|
154
155
|
set :rbenv_type, :user
|
155
|
-
set :linked_dirs, %w(log tmp/pids tmp/cache tmp/sockets vendor/bundle
|
156
|
+
set :linked_dirs, %w(log tmp/pids tmp/cache tmp/sockets vendor/bundle tmp/run)
|
156
157
|
set :keep_releases, 5
|
157
158
|
set :scm, :bundle_rsync # Need this
|
158
159
|
set :bundle_rsync_max_parallels, ENV['PARA']
|
@@ -179,20 +180,56 @@ $ bundle exec cap localhost deploy
|
|
179
180
|
For example, if you want to precompile rails assets before rsyncing,
|
180
181
|
you may add your own task before `bundle_rsync:rsync_release`.
|
181
182
|
|
182
|
-
```
|
183
|
+
```ruby
|
183
184
|
task :precompile do
|
185
|
+
config = Capistrano::BundleRsync::Config
|
184
186
|
run_locally do
|
185
187
|
Bundler.with_clean_env do
|
186
|
-
within
|
188
|
+
within config.release_path do
|
189
|
+
execute :bundle, 'install' # install development gems
|
187
190
|
execute :bundle, 'exec rake assets:precompile'
|
188
191
|
end
|
189
192
|
end
|
193
|
+
|
194
|
+
hosts = release_roles(:all)
|
195
|
+
Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host|
|
196
|
+
execute "rsync -az -e ssh #{config.release_path}/public/ #{host}:#{fetch(:deploy_to)}/shared/public"
|
197
|
+
end
|
190
198
|
end
|
191
199
|
end
|
192
200
|
|
193
201
|
before "bundle_rsync:rsync_release", "precompile"
|
194
202
|
```
|
195
203
|
|
204
|
+
## local_git scm
|
205
|
+
|
206
|
+
`bundle_rsync` supports `local_git` SCM strategy in addition to `git`.
|
207
|
+
|
208
|
+
`local_git` strategy enables to rsync the git repository located on a local path without git clone. You may find as this is useful when you need to replace files locally without commit beforehand (for example, for password embedding).
|
209
|
+
|
210
|
+
Following is an example of `config/deploy/xxxx.rb`:
|
211
|
+
|
212
|
+
Please note that `repo_url` should be a different path with the path running cap.
|
213
|
+
This strategy probably fits with a rare situation, you should use the default `git` strategy usually.
|
214
|
+
|
215
|
+
```ruby
|
216
|
+
set :branch, ENV['BRANCH'] || 'master'
|
217
|
+
set :rbenv_type, :user
|
218
|
+
set :linked_dirs, %w(log tmp/pids tmp/cache tmp/sockets vendor/bundle tmp/run)
|
219
|
+
set :keep_releases, 5
|
220
|
+
set :scm, :bundle_rsync
|
221
|
+
set :bundle_rsync_scm, 'local_git' # Set `local_git`
|
222
|
+
|
223
|
+
set :application, 'sample'
|
224
|
+
set :repo_url, "/home/sonots/sample" # Need to git clone your repository to this path beforehand.
|
225
|
+
# This path should be different with the path running cap.
|
226
|
+
set :deploy_to, "/home/sonots/sample"
|
227
|
+
set :rbenv_ruby, "2.1.2" # Required on both deploy machine and remote machines
|
228
|
+
set :ssh_options, user: 'sonots', keys: File.expand_path('~/.ssh/id_rsa')
|
229
|
+
|
230
|
+
role :app, ['127.0.0.1']
|
231
|
+
```
|
232
|
+
|
196
233
|
## FAQ
|
197
234
|
|
198
235
|
Q. What is difference with [capistrano-rsync](https://github.com/moll/capistrano-rsync)?
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano-bundle_rsync"
|
7
|
-
spec.version = "0.3.
|
7
|
+
spec.version = "0.3.2"
|
8
8
|
spec.authors = ["sonots", "tohae"]
|
9
9
|
spec.email = ["sonots@gmail.com", "tohaechan@gmail.com"]
|
10
10
|
spec.description = %q{Deploy an application and bundled gems via rsync}
|
@@ -4,6 +4,7 @@ class Capistrano::BundleRsync::Bundler < Capistrano::BundleRsync::Base
|
|
4
4
|
def install
|
5
5
|
Bundler.with_clean_env do
|
6
6
|
execute :bundle, "--gemfile #{config.local_release_path}/Gemfile --deployment --quiet --path #{config.local_bundle_path} --without development test"
|
7
|
+
execute :rm, "#{config.local_release_path}/.bundle/config"
|
7
8
|
end
|
8
9
|
end
|
9
10
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-bundle_rsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sonots
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.2.
|
120
|
+
rubygems_version: 2.2.2
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Deploy an application and bundled gems via rsync.
|