capistrano-bundle_rsync 0.2.2 → 0.2.3
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/CHANGELOG.md +6 -0
- data/README.md +24 -4
- data/capistrano-bundle_rsync.gemspec +1 -1
- data/example/config/deploy/skip_bundle.rb +6 -0
- data/lib/capistrano/bundle_rsync/config.rb +4 -0
- data/lib/capistrano/tasks/bundle_rsync.rake +14 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1035560b71b189869e32da1fb5b02fb8a303b3b7
|
4
|
+
data.tar.gz: 7863c65ce64f61ae469996437bd85f474643c48e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d36dd1494a102cec74809a5e18e8d3c7748230094718b4e0daafca5be4a43b95045272e24d0c7d5c4d2b2a0692f8ebf7dc436277ccb9679eb7c16e7dfc4ccb93
|
7
|
+
data.tar.gz: 5c10878e8c9acc5f8d975e91aad21e02e3b6158315310c624000bc8024f0112b24315720a04abbe2a5e484fc14d3732ffe08d0207c93431f1cfad748c486bc3d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -13,8 +13,8 @@ Also saves you from having to install Git and Build Tools on your production mac
|
|
13
13
|
Capistrano::BundleRsync works as followings:
|
14
14
|
|
15
15
|
1. Do `git clone --mirror URL .local_repo/mirror` on a deploy (local) machine.
|
16
|
-
2. Extract a branch by `git archive {branch}` to `.local_repo/
|
17
|
-
3. Do `bundle --without development
|
16
|
+
2. Extract a branch by `git archive {branch}` to `.local_repo/releases/{datetime}`
|
17
|
+
3. Do `bundle --without development test --path .local_repo/bundle` on a deploy (local) machine.
|
18
18
|
4. Deploy the `release` directory to remote machines by `rsync`.
|
19
19
|
5. Deploy the `bundle` directory to remote machines by `rsync`.
|
20
20
|
|
@@ -54,7 +54,7 @@ bundle_rsync_scm | `git` | SCM Strategy inside `bundle_rsync`. `git` uses git. `
|
|
54
54
|
bundle_rsync_local_base_path | `$(pwd)/.local_repo` | The base directory to clone repository
|
55
55
|
bundle_rsync_local_mirror_path | `#{base_path}/mirror"` | Path where to mirror your repository
|
56
56
|
bundle_rsync_local_releases_path | `"#{base_path}/releases"` | Path of the directory to checkout your repository
|
57
|
-
bundle_rsync_local_release_path | `"#{
|
57
|
+
bundle_rsync_local_release_path | `"#{releases_path}/#{datetime}"` | Path to checkout your repository (releases_path + release_name)
|
58
58
|
bundle_rsync_local_bundle_path | `"#{base_path}/bundle"` | Path where to bundle install gems.
|
59
59
|
bundle_rsync_config_files | `nil` | Additional files to rsync. Specified files are copied into `config` directory.
|
60
60
|
bundle_rsync_ssh_options | `ssh_options` | Configuration of ssh for rsync. Default uses the value of `ssh_options`
|
@@ -62,6 +62,7 @@ bundle_rsync_keep_releases | `keep_releases` | The number of releases to keep on
|
|
62
62
|
bundle_rsync_max_parallels | number of hosts | Number of concurrency. The default is the number of hosts to deploy.
|
63
63
|
bundle_rsync_rsync_bwlimit | nil | Configuration of rsync --bwlimit (KBPS) option. Not Avabile if `bundle_rsync_rsync_options` is specified.
|
64
64
|
bundle_rsync_rsync_options | `-az --delete` | Configuration of rsync options.
|
65
|
+
bundle_rsync_skip_bundle | nil | (Secret option) Do not `bundle` and rsync bundle.
|
65
66
|
|
66
67
|
## Task Orders
|
67
68
|
|
@@ -92,7 +93,7 @@ Or install it yourself as:
|
|
92
93
|
|
93
94
|
## Usage
|
94
95
|
|
95
|
-
Add followings to your Gemfile:
|
96
|
+
Add followings to your Gemfile (capistrano-rvm should work, but not verified):
|
96
97
|
|
97
98
|
```ruby
|
98
99
|
gem 'capistrano'
|
@@ -171,6 +172,25 @@ Deploy by following command:
|
|
171
172
|
$ bundle exec cap localhost deploy
|
172
173
|
```
|
173
174
|
|
175
|
+
## Run a custom task before rsyncing
|
176
|
+
|
177
|
+
For example, if you want to precompile rails assets before rsyncing,
|
178
|
+
you may add your own task before `bundle_rsync:rsync_release`.
|
179
|
+
|
180
|
+
```
|
181
|
+
task :precompile do
|
182
|
+
run_locally do
|
183
|
+
Bundler.with_clean_env do
|
184
|
+
within BundleRsync::Config.release_path do
|
185
|
+
execute :bundle, 'exec rake assets:precompile'
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
before "bundle_rsync:rsync_release", "precompile"
|
192
|
+
```
|
193
|
+
|
174
194
|
## FAQ
|
175
195
|
|
176
196
|
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.2.
|
7
|
+
spec.version = "0.2.3"
|
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}
|
@@ -83,5 +83,9 @@ module Capistrano::BundleRsync
|
|
83
83
|
bwlimit = fetch(:bundle_rsync_rsync_bwlimit) ? " --bwlimit #{fetch(:bundle_rsync_rsync_bwlimit)}" : ""
|
84
84
|
fetch(:bundle_rsync_rsync_options) || "-az --delete#{bwlimit}"
|
85
85
|
end
|
86
|
+
|
87
|
+
def self.skip_bundle
|
88
|
+
fetch(:bundle_rsync_skip_bundle)
|
89
|
+
end
|
86
90
|
end
|
87
91
|
end
|
@@ -5,6 +5,10 @@ require 'parallel'
|
|
5
5
|
require 'capistrano/bundle_rsync/bundler'
|
6
6
|
|
7
7
|
namespace :bundle_rsync do
|
8
|
+
def config
|
9
|
+
Capistrano::BundleRsync::Config
|
10
|
+
end
|
11
|
+
|
8
12
|
def bundler
|
9
13
|
@bundler ||= Capistrano::BundleRsync::Bundler.new(self)
|
10
14
|
end
|
@@ -24,13 +28,21 @@ namespace :bundle_rsync do
|
|
24
28
|
namespace :bundler do
|
25
29
|
task :install do
|
26
30
|
run_locally do
|
27
|
-
|
31
|
+
if config.skip_bundle
|
32
|
+
info "Skip bundle"
|
33
|
+
else
|
34
|
+
bundler.install
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
30
38
|
|
31
39
|
task :rsync do
|
32
40
|
run_locally do
|
33
|
-
|
41
|
+
if config.skip_bundle
|
42
|
+
info "Skip bundle rsync"
|
43
|
+
else
|
44
|
+
bundler.rsync
|
45
|
+
end
|
34
46
|
end
|
35
47
|
end
|
36
48
|
end
|
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.2.
|
4
|
+
version: 0.2.3
|
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-07-
|
12
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- example/config/deploy.rb
|
88
88
|
- example/config/deploy/local_git.rb
|
89
89
|
- example/config/deploy/sample.rb
|
90
|
+
- example/config/deploy/skip_bundle.rb
|
90
91
|
- lib/capistrano-bundle_rsync.rb
|
91
92
|
- lib/capistrano/bundle_rsync.rb
|
92
93
|
- lib/capistrano/bundle_rsync/base.rb
|