capistrano-bundle_rsync 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +8 -7
- data/capistrano-bundle_rsync.gemspec +1 -1
- data/example/README.md +7 -0
- data/example/config/deploy.rb +2 -2
- data/example/config/deploy/git.rb +24 -0
- data/lib/capistrano/bundle_rsync/bundler.rb +3 -1
- data/lib/capistrano/bundle_rsync/git.rb +7 -1
- metadata +5 -4
- data/example/config/deploy/sample.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22c2743195991ea4910fac6fae9e521b7a4c4fb9
|
4
|
+
data.tar.gz: 3b56d781ba6bb30bc140aba5048225c62c2bc76c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1ecb673add2d7e4ebc3fb8b172212a2b7e1d9a911f329a14331c5a0059c91f1171fe8c62c634c480683f2ba74a1a6fc5b496ed1ea2b5df011a4eeefdec1abaf
|
7
|
+
data.tar.gz: 9fbff9b33e2cb0cdc464ecd0a7da0dc2a2a0708e943b591d36bf496d2fd13f8a9d49b67471c082657160cbf292018c35b2b759e21a3da7a278d8df36cae10d0e
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -46,6 +46,7 @@ Set Capistrano variables with `set name, value`.
|
|
46
46
|
Name | Default | Description
|
47
47
|
--------------|---------|------------
|
48
48
|
repo_url | `.` | The path or URL to a Git repository to clone from.
|
49
|
+
repo_tree | nil | Specify the subtree path of the repository to deploy.
|
49
50
|
branch | `master` | The Git branch to checkout.
|
50
51
|
ssh_options | `{}` | Configuration of ssh :user and :keys.
|
51
52
|
keep\_releases | 5 | The number of releases to keep.
|
@@ -54,7 +55,7 @@ bundle_rsync_scm | `git` | SCM Strategy inside `bundle_rsync`. `git` uses git. `
|
|
54
55
|
bundle_rsync_local_base_path | `$(pwd)/.local_repo` | The base directory to clone repository
|
55
56
|
bundle_rsync_local_mirror_path | `#{base_path}/mirror"` | Path where to mirror your repository
|
56
57
|
bundle_rsync_local_releases_path | `"#{base_path}/releases"` | Path of the directory to checkout your repository
|
57
|
-
bundle_rsync_local_release_path | `"#{releases_path}/#{datetime}"` | Path to checkout your repository (releases_path + release_name). If you specify this, `keep_releases` for local releases path is disabled because `datetime` directories are no longer created.
|
58
|
+
bundle_rsync_local_release_path | `"#{releases_path}/#{datetime}"` | Path to checkout your repository (releases_path + release_name). If you specify this, `keep_releases` for local releases path is disabled because `datetime` directories are no longer created. This parameter is set as `repo_url` in the case of `local_git` as default.
|
58
59
|
bundle_rsync_local_bundle_path | `"#{base_path}/bundle"` | Path where to bundle install gems.
|
59
60
|
bundle_rsync_ssh_options | `ssh_options` | Configuration of ssh for rsync. Default uses the value of `ssh_options`
|
60
61
|
bundle_rsync_keep_releases | `keep_releases` | The number of releases to keep on .local_repo
|
@@ -185,7 +186,7 @@ task :precompile do
|
|
185
186
|
config = Capistrano::BundleRsync::Config
|
186
187
|
run_locally do
|
187
188
|
Bundler.with_clean_env do
|
188
|
-
within config.
|
189
|
+
within config.local_release_path do
|
189
190
|
execute :bundle, 'install' # install development gems
|
190
191
|
execute :bundle, 'exec rake assets:precompile'
|
191
192
|
end
|
@@ -193,7 +194,7 @@ task :precompile do
|
|
193
194
|
|
194
195
|
hosts = release_roles(:all)
|
195
196
|
Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host|
|
196
|
-
execute "rsync -az -e ssh #{config.
|
197
|
+
execute "rsync -az -e ssh #{config.local_release_path}/public/ #{host}:#{fetch(:deploy_to)}/shared/public"
|
197
198
|
end
|
198
199
|
end
|
199
200
|
end
|
@@ -221,10 +222,10 @@ set :scm, :bundle_rsync
|
|
221
222
|
set :bundle_rsync_scm, 'local_git' # Set `local_git`
|
222
223
|
|
223
224
|
set :application, 'sample'
|
224
|
-
set :repo_url, "/
|
225
|
-
|
226
|
-
set :deploy_to, "/
|
227
|
-
set :rbenv_ruby, "2.1.2" # Required on both deploy machine and remote machines
|
225
|
+
set :repo_url, "/path/to/app/local" # Need to git clone your repository to this path beforehand.
|
226
|
+
# This path should be different with the path running cap.
|
227
|
+
set :deploy_to, "/path/to/app/production"
|
228
|
+
set :rbenv_ruby, "2.1.2" # Required the same ruby on both deploy machine and remote machines
|
228
229
|
set :ssh_options, user: 'sonots', keys: File.expand_path('~/.ssh/id_rsa')
|
229
230
|
|
230
231
|
role :app, ['127.0.0.1']
|
@@ -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.
|
7
|
+
spec.version = "0.4.0"
|
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}
|
data/example/README.md
ADDED
data/example/config/deploy.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
set :user,
|
1
|
+
set :user, `whoami`.chomp
|
2
2
|
set :ssh_options, user: ENV['USER'], keys: [File.expand_path('~/.ssh/id_rsa')]
|
3
3
|
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
4
4
|
|
5
5
|
set :linked_dirs, %w(log tmp/pids vendor/bundle)
|
6
6
|
set :keep_releases, 5
|
7
7
|
set :rbenv_type, :user
|
8
|
-
set :rbenv_ruby, '2.1.5'
|
8
|
+
set :rbenv_ruby, RUBY_VERSION # '2.1.5'
|
9
9
|
set :deploy_to, "#{ENV['HOME']}/sample"
|
10
10
|
|
11
11
|
set :scm, :bundle_rsync
|
@@ -0,0 +1,24 @@
|
|
1
|
+
set :bundle_rsync_scm, 'git'
|
2
|
+
set :repo_url, 'https://github.com/sonots/try_rails4'
|
3
|
+
set :branch, 'master'
|
4
|
+
|
5
|
+
role :app, ['127.0.0.1']
|
6
|
+
|
7
|
+
task :precompile do
|
8
|
+
config = Capistrano::BundleRsync::Config
|
9
|
+
run_locally do
|
10
|
+
Bundler.with_clean_env do
|
11
|
+
within config.local_release_path do
|
12
|
+
execute :bundle, 'install' # install development gems
|
13
|
+
execute :bundle, 'exec rake assets:precompile'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
hosts = release_roles(:all)
|
18
|
+
Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host|
|
19
|
+
execute "rsync -az -e ssh #{config.local_release_path}/public/ #{host}:#{fetch(:deploy_to)}/shared/public"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
before "bundle_rsync:rsync_release", "precompile"
|
@@ -35,7 +35,9 @@ BUNDLE_BIN: #{release_path.join('bin')}
|
|
35
35
|
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{bundle_config_path} #{host}:#{release_path}/.bundle/config"
|
36
36
|
end
|
37
37
|
|
38
|
-
# Do not remove if :bundle_rsync_local_release_path is directly specified
|
38
|
+
# Do not remove if :bundle_rsync_local_release_path is directly specified
|
39
|
+
# because releases/#{datetime} directories are not created in such case.
|
40
|
+
# Note that :bundle_rsync_local_release_path is automatically set when `local_git` scm is used.
|
39
41
|
unless fetch(:bundle_rsync_local_release_path)
|
40
42
|
releases = capture(:ls, '-x', config.local_releases_path).split
|
41
43
|
if releases.count >= config.keep_releases
|
@@ -24,7 +24,13 @@ class Capistrano::BundleRsync::Git < Capistrano::BundleRsync::SCM
|
|
24
24
|
execute "mkdir -p #{config.local_release_path}"
|
25
25
|
|
26
26
|
within config.local_mirror_path do
|
27
|
-
|
27
|
+
if tree = fetch(:repo_tree)
|
28
|
+
stripped = tree.slice %r#^/?(.*?)/?$#, 1 # strip both side /
|
29
|
+
num_components = stripped.count('/')
|
30
|
+
execute :git, :archive, fetch(:branch), tree, "| tar -x --strip-components #{num_components} -f - -C ", "#{config.local_release_path}"
|
31
|
+
else
|
32
|
+
execute :git, :archive, fetch(:branch), '| tar -x -C', "#{config.local_release_path}"
|
33
|
+
end
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
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.
|
4
|
+
version: 0.4.0
|
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: 2015-
|
12
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -84,9 +84,10 @@ files:
|
|
84
84
|
- capistrano-bundle_rsync.gemspec
|
85
85
|
- example/Capfile
|
86
86
|
- example/Gemfile
|
87
|
+
- example/README.md
|
87
88
|
- example/config/deploy.rb
|
89
|
+
- example/config/deploy/git.rb
|
88
90
|
- example/config/deploy/local_git.rb
|
89
|
-
- example/config/deploy/sample.rb
|
90
91
|
- example/config/deploy/skip_bundle.rb
|
91
92
|
- lib/capistrano-bundle_rsync.rb
|
92
93
|
- lib/capistrano/bundle_rsync.rb
|
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
118
|
version: '0'
|
118
119
|
requirements: []
|
119
120
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.4.5
|
121
122
|
signing_key:
|
122
123
|
specification_version: 4
|
123
124
|
summary: Deploy an application and bundled gems via rsync.
|