capistrano-bundle_rsync 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +4 -3
- data/capistrano-bundle_rsync.gemspec +1 -1
- data/lib/capistrano/bundle_rsync/config.rb +5 -0
- data/lib/capistrano/tasks/bundle_rsync.rake +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 947571b6493b5ee9d817038173d85843861ee994
|
4
|
+
data.tar.gz: 81ad9af1b67a3fe55548e179bca2db5f12ea61aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15002e2ae62bd357856bedb2e9baba480a65457fc26765f11ebb40a26d8d8c0f20071a2c184ef298b04b606ec2424dbf20a35785b42ed231b043f604d52b6746
|
7
|
+
data.tar.gz: 2472e6d00b1da760721fa0ebd7122cb97df1c2319ea8b0e48f35ae9e3401dc580a5485246500b3a3477ac4f9b59f581de57941970ad472911fa0e1e327693d07
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,8 +4,7 @@ Deploy an application and bundled gems via rsync
|
|
4
4
|
|
5
5
|
## What is this for?
|
6
6
|
|
7
|
-
Capistrano::BundleRsync
|
8
|
-
which saves you from building gems on each your production machine.
|
7
|
+
Capistrano::BundleRsync builds (bundle) gems only once on a deploy machine and transfers gems to your production machines via rsync, which saves you from building gems on each your production machine.
|
9
8
|
|
10
9
|
Also saves you from having to install Git and Build Tools on your production machine.
|
11
10
|
|
@@ -57,6 +56,8 @@ bundle_rsync_local_bin_path | `"#{base_path}/bin"` | Path where to bundle instal
|
|
57
56
|
bundle_rsync_config_files | `nil` | Additional files to rsync. Specified files are copied into `config` directory.
|
58
57
|
bundle_rsync_ssh_options | `ssh_options` | Configuration of ssh for rsync. Default uses the value of `ssh_options`
|
59
58
|
bundle_rsync_max_parallels | number of hosts | Number of concurrency. The default is the number of hosts to deploy.
|
59
|
+
bundle_rsync_rsync_bwlimit | nil | Configuration of rsync --bwlimit (KBPS) option. Not Avabile if `bundle_rsync_rsync_options` is specified.
|
60
|
+
bundle_rsync_rsync_options | `-az --delete` | Configuration of rsync options.
|
60
61
|
|
61
62
|
## Installation
|
62
63
|
|
@@ -135,6 +136,7 @@ set :linked_dirs, %w(bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public
|
|
135
136
|
set :keep_releases, 5
|
136
137
|
set :scm, :bundle_rsync # Need this
|
137
138
|
set :bundle_rsync_max_parallels, ENV['PARA']
|
139
|
+
set :bundle_rsync_rsync_bwlimit, ENV['BWLIMIT'] # like 20000
|
138
140
|
set :bundle_rsync_config_files, ['~/config/database.yml']
|
139
141
|
|
140
142
|
set :application, 'sample'
|
@@ -160,7 +162,6 @@ A. capistrano-bundle\_rsync does `bundle install` at the deploy machine, not on
|
|
160
162
|
|
161
163
|
## ToDo
|
162
164
|
|
163
|
-
1. Support rsync_options
|
164
165
|
2. Support other SCMs than `git`.
|
165
166
|
|
166
167
|
## ChangeLog
|
@@ -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.1.
|
7
|
+
spec.version = "0.1.1"
|
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}
|
@@ -74,5 +74,10 @@ module Capistrano::BundleRsync
|
|
74
74
|
def self.max_parallels(hosts)
|
75
75
|
fetch(:bundle_rsync_max_parallels) || hosts.size
|
76
76
|
end
|
77
|
+
|
78
|
+
def self.rsync_options
|
79
|
+
bwlimit = fetch(:bundle_rsync_rsync_bwlimit) ? " --bwlimit #{fetch(:bundle_rsync_rsync_bwlimit)}" : ""
|
80
|
+
fetch(:bundle_rsync_rsync_options) || "-az --delete#{bwlimit}"
|
81
|
+
end
|
77
82
|
end
|
78
83
|
end
|
@@ -33,18 +33,19 @@ BUNDLE_BIN: #{shared_path.join('bin')}
|
|
33
33
|
bundle_config_path = "#{config.local_base_path}/bundle_config"
|
34
34
|
File.open(bundle_config_path, "w") {|file| file.print(lines) }
|
35
35
|
|
36
|
+
rsync_options = config.rsync_options
|
36
37
|
Parallel.each(hosts, in_processes: config.max_parallels(hosts)) do |host|
|
37
38
|
ssh = config.build_ssh_command(host)
|
38
39
|
if config_files = config.config_files
|
39
40
|
config_files.each do |config_file|
|
40
41
|
basename = File.basename(config_file)
|
41
|
-
execute :rsync, "
|
42
|
+
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{config_file} #{host}:#{release_path}/config/#{basename}"
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
45
|
-
execute :rsync, "
|
46
|
-
execute :rsync, "
|
47
|
-
execute :rsync, "
|
46
|
+
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{config.local_bundle_path}/ #{host}:#{shared_path}/bundle/"
|
47
|
+
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{config.local_bin_path}/ #{host}:#{shared_path}/bin/"
|
48
|
+
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{bundle_config_path} #{host}:#{release_path}/.bundle/config"
|
48
49
|
end
|
49
50
|
|
50
51
|
FileUtils.rm_rf(config.local_release_path)
|
@@ -91,9 +92,10 @@ BUNDLE_BIN: #{shared_path.join('bin')}
|
|
91
92
|
execute :git, :archive, fetch(:branch), '| tar -x -C', "#{config.local_release_path}"
|
92
93
|
end
|
93
94
|
|
95
|
+
rsync_options = config.rsync_options
|
94
96
|
Parallel.each(hosts, in_processes: config.max_parallels(hosts)) do |host|
|
95
97
|
ssh = config.build_ssh_command(host)
|
96
|
-
execute :rsync, "
|
98
|
+
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{config.local_release_path}/ #{host}:#{release_path}/"
|
97
99
|
end
|
98
100
|
end
|
99
101
|
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.1.
|
4
|
+
version: 0.1.1
|
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-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|