capistrano-bundle_rsync 0.2.1 → 0.2.2

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: 729833358d2b8f992b042929584cd4a9bac680c6
4
- data.tar.gz: 75ffda19038ade33a7b76c34a714e16642612dc6
3
+ metadata.gz: 4081c3980ab6875e68c72e7b8c3582b2e2edd2f8
4
+ data.tar.gz: 587a0ad49eae6c909c5a59470dd716bf4e736af4
5
5
  SHA512:
6
- metadata.gz: 4fc0348121a5b5ade9a1b1510bb37528bb8fc785af148d6312f5b41476b2905e3914977b206b90bd0a47bcb6118c672b9159958cd6f8ff4b7f3f3b1308d83f44
7
- data.tar.gz: f569840201a463109e537fd9007068a9d0bb7244096544f43c0a16105f6ab8a7faf281c2302079ebabaf0acd8ee68613be38fec010a127f3dedf78451d23e754
6
+ metadata.gz: cbb74da8fe02fae8f4675e0db703c3b23901c06f052f8e56c77bf86bc6fd10c7fb2613cb47c6d06f73a1dacb22cf11ec219a96c2e4bdafef160aa53f756753f8
7
+ data.tar.gz: d79a9c1d0cd7c430f019bdba761051a32bb85a8ef0e48e523398d249dbb249633dedfd587a31b74fb9f3aa545cc54008ab1897d2a22feb3fa82b2f2c28b0b938
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.2.2 (2014/07/17)
2
+
3
+ Changes:
4
+
5
+ * Split rsync tasks and reorder tasks to be better
6
+
1
7
  # 0.2.1 (2014/07/11)
2
8
 
3
9
  Fixes:
data/README.md CHANGED
@@ -14,8 +14,8 @@ Capistrano::BundleRsync works as followings:
14
14
 
15
15
  1. Do `git clone --mirror URL .local_repo/mirror` on a deploy (local) machine.
16
16
  2. Extract a branch by `git archive {branch}` to `.local_repo/release_{time}`
17
- 4. Deploy the `release` directory to remote machines by `rsync`.
18
17
  3. Do `bundle --without development,test --path .local_repo/bundle` on a deploy (local) machine.
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
 
21
21
  ## Prerequisites
@@ -50,6 +50,7 @@ branch | `master` | The Git branch to checkout.
50
50
  ssh_options | `{}` | Configuration of ssh :user and :keys.
51
51
  keep\_releases | 5 | The number of releases to keep.
52
52
  scm | nil | Must be `bundle_rsync` to use capistrano-bundle_rsync.
53
+ bundle_rsync_scm | `git` | SCM Strategy inside `bundle_rsync`. `git` uses git. `local_git` also uses git, but it enables to rsync the git repository located on local path directly without git clone. `repo_url` must be the local directory path to use `local_git`.
53
54
  bundle_rsync_local_base_path | `$(pwd)/.local_repo` | The base directory to clone repository
54
55
  bundle_rsync_local_mirror_path | `#{base_path}/mirror"` | Path where to mirror your repository
55
56
  bundle_rsync_local_releases_path | `"#{base_path}/releases"` | Path of the directory to checkout your repository
@@ -61,7 +62,19 @@ bundle_rsync_keep_releases | `keep_releases` | The number of releases to keep on
61
62
  bundle_rsync_max_parallels | number of hosts | Number of concurrency. The default is the number of hosts to deploy.
62
63
  bundle_rsync_rsync_bwlimit | nil | Configuration of rsync --bwlimit (KBPS) option. Not Avabile if `bundle_rsync_rsync_options` is specified.
63
64
  bundle_rsync_rsync_options | `-az --delete` | Configuration of rsync options.
64
- bundle_rsync_scm | 'git' or 'local_git' | SCM Strategy inside `bundle_rsync`. `git` uses git. `local_git` also uses git, but it enables to rsync the git repository located on local path directly without git clone. `repo_url` must be the local directory path to use `local_git`.
65
+
66
+ ## Task Orders
67
+
68
+ ```
69
+ ** Execute bundle_rsync:check
70
+ ** Execute bundle_rsync:clone
71
+ ** Execute bundle_rsync:update
72
+ ** Execute bundle_rsync:create_release
73
+ ** Execute bundle_rsync:bundler:install
74
+ ** Execute bundle_rsync:rsync_release
75
+ ** Execute bundle_rsync:bundler:rsync
76
+ ** Execute bundle_rsync:set_current_revision
77
+ ```
65
78
 
66
79
  ## Installation
67
80
 
@@ -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.1"
7
+ spec.version = "0.2.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}
@@ -1,20 +1,19 @@
1
1
  require 'capistrano/bundle_rsync/base'
2
2
 
3
3
  class Capistrano::BundleRsync::Bundler < Capistrano::BundleRsync::Base
4
- def prepare
4
+ def install
5
+ Bundler.with_clean_env do
6
+ execute :bundle, "--gemfile #{config.local_release_path}/Gemfile --deployment --quiet --path #{config.local_bundle_path} --without development test"
7
+ end
8
+ end
9
+
10
+ def rsync
5
11
  hosts = release_roles(:all)
6
12
  on hosts, in: :groups, limit: config.max_parallels(hosts) do
7
13
  within release_path do
8
14
  execute :mkdir, '-p', '.bundle'
9
15
  end
10
16
  end
11
- end
12
-
13
- def install
14
- hosts = release_roles(:all)
15
- Bundler.with_clean_env do
16
- execute :bundle, "--gemfile #{config.local_release_path}/Gemfile --deployment --quiet --path #{config.local_bundle_path} --without development test"
17
- end
18
17
 
19
18
  lines = <<-EOS
20
19
  ---
@@ -21,13 +21,15 @@ class Capistrano::BundleRsync::Git < Capistrano::BundleRsync::SCM
21
21
  end
22
22
 
23
23
  def create_release
24
- hosts = release_roles(:all)
25
24
  execute "mkdir -p #{config.local_release_path}"
26
25
 
27
26
  within config.local_mirror_path do
28
27
  execute :git, :archive, fetch(:branch), '| tar -x -C', "#{config.local_release_path}"
29
28
  end
29
+ end
30
30
 
31
+ def rsync_release
32
+ hosts = release_roles(:all)
31
33
  rsync_options = config.rsync_options
32
34
  Parallel.each(hosts, in_processes: config.max_parallels(hosts)) do |host|
33
35
  ssh = config.build_ssh_command(host)
@@ -14,6 +14,9 @@ class Capistrano::BundleRsync::LocalGit < Capistrano::BundleRsync::SCM
14
14
  end
15
15
 
16
16
  def create_release
17
+ end
18
+
19
+ def rsync_release
17
20
  hosts = release_roles(:all)
18
21
  rsync_options = config.rsync_options
19
22
  Parallel.each(hosts, in_processes: config.max_parallels(hosts)) do |host|
@@ -23,11 +23,16 @@ namespace :bundle_rsync do
23
23
 
24
24
  namespace :bundler do
25
25
  task :install do
26
- bundler.prepare
27
26
  run_locally do
28
27
  bundler.install
29
28
  end
30
29
  end
30
+
31
+ task :rsync do
32
+ run_locally do
33
+ bundler.rsync
34
+ end
35
+ end
31
36
  end
32
37
 
33
38
  desc 'Check that the repository is reachable'
@@ -58,6 +63,14 @@ namespace :bundle_rsync do
58
63
  end
59
64
  end
60
65
 
66
+ # additional extra tasks of bundle_rsync scm
67
+ desc 'Rsync releases'
68
+ task :rsync_release do
69
+ run_locally do
70
+ scm.rsync_release
71
+ end
72
+ end
73
+
61
74
  desc 'Determine the revision that will be deployed'
62
75
  task :set_current_revision do
63
76
  run_locally do
@@ -65,6 +78,8 @@ namespace :bundle_rsync do
65
78
  end
66
79
  end
67
80
 
68
- before 'deploy:updated', 'bundle_rsync:bundler:install'
81
+ after 'bundle_rsync:create_release', 'bundle_rsync:bundler:install'
82
+ after 'bundle_rsync:bundler:install', 'bundle_rsync:rsync_release'
83
+ after 'bundle_rsync:rsync_release', 'bundle_rsync:bundler:rsync'
69
84
  end
70
85
  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.1
4
+ version: 0.2.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-07-11 00:00:00.000000000 Z
12
+ date: 2014-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano