capistrano-withrsync 0.0.1 → 0.0.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: 3dc836514cd56e010f35c2998c3bebb2265b8968
4
- data.tar.gz: e13b8154050308fa253e6d7abeee4a488955ec9a
3
+ metadata.gz: 0605cbea97049b12351f082eba5848e338ec1058
4
+ data.tar.gz: 365992c2486e997d51281f9041d2f891c274e79a
5
5
  SHA512:
6
- metadata.gz: d5de3c79d18374a49a24efcdd921d8dba6e07e5afbd38288f803250ca080e4af3d24072347bdad44bab443651eb5bc88facaed18c058c162c5ad19dfc46f9ea2
7
- data.tar.gz: 63bebc5ed87b0012e09c17a37c47c24b636726fdb9a5ef05e5a5a1334696b5625b7616be619350541eeb1a9ba3137840c1fcfd450540da8438bfb69d702ebca5
6
+ metadata.gz: b7a38a7b61021b84ab8a024d0aed108400e120d13c0251d407661e9b3bdc722352e26cae6112b7f3de0749ea2a1d0e1518d3661efd5c2a171d312bcab7b6e7b5
7
+ data.tar.gz: 0237150e5894e030a2f0d425452cdd2324fb00a4d773a3a80f7a092fd9f1a363aa07b9881514ce83d33f0dc6ec5b76cd335e85334d365dfdb8b0f3803a63264c
data/README.md CHANGED
@@ -56,11 +56,11 @@ Configuration
56
56
 
57
57
  Set capistrano variables with `set name, value`.
58
58
 
59
- Name | Default | Description
60
- ------------- |-------- |------------
61
- rsync_stage | `tmp/deploy` | Path where to clone your repository for staging, checkouting and rsyncing. Can be both relative or absolute.
62
- rsync_cache | `shared/deploy` | Path where to cache your repository on the server to avoid rsyncing from scratch each time. Can be both relative or absolute.<br> Set to `nil` if you want to disable the cache.
63
- rsync_options | `%w(--recursive --delete --delete-excluded --exclude .git* --exclude .svn*)` | Array of options to pass to `rsync`.
59
+ name | default | description
60
+ ------------- | -------- | ------------
61
+ rsync_src | `tmp/deploy` | rsync src path
62
+ rsync_dest | `shared/deploy` | rsync dest path
63
+ rsync_options | `%w(--recursive --delete --delete-excluded --exclude .git* --exclude .svn*)` | rsync options
64
64
 
65
65
  Contributing
66
66
  ------------
@@ -16,13 +16,13 @@ namespace :rsync do
16
16
  --xattrs
17
17
  )
18
18
 
19
- set :rsync_stage, 'tmp/deploy'
20
- set :rsync_cache, 'shared/deploy'
19
+ set :rsync_src, 'tmp/deploy'
20
+ set :rsync_dest, 'shared/deploy'
21
21
 
22
- set :rsync_cache_path, -> {
23
- cache = fetch(:rsync_cache)
24
- cache = "#{deploy_to}/#{cache}" if cache && cache !~ /^\//
25
- cache
22
+ set :rsync_dest_fullpath, -> {
23
+ path = fetch(:rsync_dest)
24
+ path = "#{deploy_to}/#{path}" if path && path !~ /^\//
25
+ path
26
26
  }
27
27
 
28
28
  desc 'Override scm tasks'
@@ -50,24 +50,24 @@ namespace :rsync do
50
50
  desc 'Create a destination for rsync on deployment hosts'
51
51
  task :create_dest do
52
52
  on release_roles :all do
53
- path = File.join fetch(:deploy_to), fetch(:rsync_cache)
53
+ path = File.join fetch(:deploy_to), fetch(:rsync_dest)
54
54
  execute :mkdir, '-pv', path
55
55
  end
56
56
  end
57
57
 
58
58
  desc 'Create a source for rsync'
59
59
  task :create_src do
60
- next if File.directory? fetch(:rsync_stage)
60
+ next if File.directory? fetch(:rsync_src)
61
61
 
62
62
  run_locally do
63
- execute :git, :clone, fetch(:repo_url), fetch(:rsync_stage)
63
+ execute :git, :clone, fetch(:repo_url), fetch(:rsync_src)
64
64
  end
65
65
  end
66
66
 
67
67
  desc 'Stage the repository in a local directory'
68
68
  task stage: :'rsync:create_src' do
69
69
  run_locally do
70
- within fetch(:rsync_stage) do
70
+ within fetch(:rsync_src) do
71
71
  execute :git, :fetch, '--quiet --all --prune'
72
72
  execute :git, :reset, "--hard origin/#{fetch(:branch)}"
73
73
  set :current_revision, "#{`git rev-parse --short HEAD`}".chomp
@@ -82,8 +82,8 @@ namespace :rsync do
82
82
  run_locally do
83
83
  user = "#{role.user}@" if !role.user.nil?
84
84
  rsync_options = "#{fetch(:rsync_options).join(' ')}"
85
- rsync_from = "#{fetch(:rsync_stage)}/"
86
- rsync_to = "#{user}#{role.hostname}:#{fetch(:rsync_cache_path) || release_path}"
85
+ rsync_from = "#{fetch(:rsync_src)}/"
86
+ rsync_to = "#{user}#{role.hostname}:#{fetch(:rsync_dest_fullpath) || release_path}"
87
87
 
88
88
  unless rsync_to == last_rsync_to
89
89
  execute :rsync, rsync_options, rsync_from, rsync_to
@@ -95,12 +95,12 @@ namespace :rsync do
95
95
 
96
96
  desc 'Copy the code to the releases directory'
97
97
  task release: :'rsync:sync' do
98
- next if !fetch(:rsync_cache)
98
+ next if !fetch(:rsync_dest)
99
99
 
100
100
  on release_roles :all do
101
101
  execute :rsync,
102
102
  "#{fetch(:rsync_copy_options).join(' ')}",
103
- "#{fetch(:rsync_cache_path)}/",
103
+ "#{fetch(:rsync_dest_fullpath)}/",
104
104
  "#{release_path}/"
105
105
  end
106
106
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Withrsync
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-withrsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - linyows