capistrano-withrsync 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/README.md +4 -1
- data/capistrano-withrsync.gemspec +1 -1
- data/lib/capistrano/tasks/withrsync.rake +5 -2
- data/lib/capistrano/withrsync/version.rb +1 -1
- data/spec/feature_spec.rb +17 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/tid/Capfile +3 -0
- data/spec/tid/Dockerfile +9 -0
- data/spec/tid/Gemfile +3 -0
- data/spec/tid/config/deploy/test.rb +24 -0
- data/spec/tid/config/deploy.rb +8 -0
- data/spec/tid/id_rsa +27 -0
- data/spec/tid/id_rsa.pub +1 -0
- data/wercker.yml +23 -0
- metadata +28 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3857f6cbf8f5a52949bba4fef1f75b522a7a2aa2
|
4
|
+
data.tar.gz: 438f4a5407faf4cc3387ef068024eb0f5ed37c9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3789641297014e0b923ec650f2d9a9a6687890ae6be4bef8893f44002b04a8c6fa6777312b6e12809b3a9081f434cebac6577ef0a21cbaa76a2bc13a75490eec
|
7
|
+
data.tar.gz: ade8985d8d19fd66c3d7beec32672f598c6ecc5181b282ade448085d625ff811475a382c97e9af5f358c28a36eddb0da2a8f484d0cb22ec82e5889f2a0f1b540
|
data/.rspec
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,10 +3,12 @@ Capistrano with Rsync
|
|
3
3
|
|
4
4
|
Capistrano with rsync to deployment hosts from local repository.
|
5
5
|
|
6
|
-
[![Gem version](https://
|
6
|
+
[![Gem version](https://img.shields.io/gem/v/capistrano-withrsync.svg?style=flat-square)][gem]
|
7
|
+
[![Wercker](https://img.shields.io/wercker/ci/54e13fa93e143292231f6e0a.svg?style=flat-square)][wercker]
|
7
8
|
|
8
9
|
[capistrano]: https://github.com/capistrano/capistrano
|
9
10
|
[gem]: https://rubygems.org/gems/capistrano-withrsync
|
11
|
+
[wercker]: https://app.wercker.com/project/bykey/195d63561202a1415822a18e0fd35994
|
10
12
|
|
11
13
|
Requirements
|
12
14
|
------------
|
@@ -61,6 +63,7 @@ Name | Default
|
|
61
63
|
rsync_src | tmp/deploy | rsync src path
|
62
64
|
rsync_dest | shared/deploy | rsync dest path
|
63
65
|
rsync_options | --recursive --delete --delete-excluded <br>--exclude .git* --exclude .svn* | rsync options
|
66
|
+
rsync_with_submodules | false | fetch and update git submodules for syncing
|
64
67
|
|
65
68
|
Overview
|
66
69
|
--------
|
@@ -25,6 +25,8 @@ namespace :rsync do
|
|
25
25
|
path
|
26
26
|
}
|
27
27
|
|
28
|
+
set :rsync_with_submodules, false
|
29
|
+
|
28
30
|
desc 'Override scm tasks'
|
29
31
|
task :override_scm do
|
30
32
|
Rake::Task[:"#{scm}:check"].delete
|
@@ -66,7 +68,7 @@ namespace :rsync do
|
|
66
68
|
next if File.directory? fetch(:rsync_src)
|
67
69
|
|
68
70
|
run_locally do
|
69
|
-
execute :git, :clone, fetch(:repo_url), fetch(:rsync_src)
|
71
|
+
execute :git, :clone, ('--recursive' if fetch(:rsync_with_submodules)), fetch(:repo_url), fetch(:rsync_src)
|
70
72
|
end
|
71
73
|
end
|
72
74
|
|
@@ -74,8 +76,9 @@ namespace :rsync do
|
|
74
76
|
task stage: :'rsync:create_src' do
|
75
77
|
run_locally do
|
76
78
|
within fetch(:rsync_src) do
|
77
|
-
execute :git, :fetch, '--quiet --all --prune'
|
79
|
+
execute :git, :fetch, ('--recurse-submodules=on-demand' if fetch(:rsync_with_submodules)), '--quiet --all --prune'
|
78
80
|
execute :git, :reset, "--hard origin/#{fetch(:branch)}"
|
81
|
+
execute :git, :submodule, :update, '--init' if fetch(:rsync_with_submodules)
|
79
82
|
end
|
80
83
|
end
|
81
84
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
RSpec.describe 'Capistrano with Rsync' do
|
2
|
+
describe '# bundle exec cap test deploy' do
|
3
|
+
it 'successful' do
|
4
|
+
Dir.chdir ENV['TID_BASE_PATH'] do
|
5
|
+
_, _, ex = cmd 'bundle exec cap test deploy'
|
6
|
+
expect(ex.exitstatus).to eq 0
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'puts some string' do
|
11
|
+
Dir.chdir ENV['TID_BASE_PATH'] do
|
12
|
+
out, _, _ = cmd 'bundle exec cap test deploy'
|
13
|
+
expect(out).to include 'Running /usr/bin/env rsync -e \'ssh -p'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'tid'
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
config.expect_with :rspec do |expectations|
|
5
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
6
|
+
end
|
7
|
+
|
8
|
+
config.mock_with :rspec do |mocks|
|
9
|
+
mocks.verify_partial_doubles = true
|
10
|
+
end
|
11
|
+
|
12
|
+
config.include(Tid)
|
13
|
+
config.before(:all) {
|
14
|
+
Tid.bundle
|
15
|
+
Tid.prepare
|
16
|
+
}
|
17
|
+
config.after(:all) { Tid.clear }
|
18
|
+
end
|
data/spec/tid/Capfile
ADDED
data/spec/tid/Dockerfile
ADDED
data/spec/tid/Gemfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
host = ENV['TID_HOSTNAME']
|
2
|
+
port = ENV['TID_PORT']
|
3
|
+
|
4
|
+
server host,
|
5
|
+
user: 'root',
|
6
|
+
roles: %w(app),
|
7
|
+
ssh_options: {
|
8
|
+
port: port,
|
9
|
+
user: 'root',
|
10
|
+
keys: %w(./id_rsa),
|
11
|
+
forward_agent: false,
|
12
|
+
auth_methods: %w(publickey)
|
13
|
+
}
|
14
|
+
|
15
|
+
namespace :rsync do
|
16
|
+
set :rsync_options, [
|
17
|
+
"-e 'ssh -p #{port} -i ./id_rsa'",
|
18
|
+
'--recursive',
|
19
|
+
'--delete',
|
20
|
+
'--delete-excluded',
|
21
|
+
'--exclude .git*',
|
22
|
+
'--exclude .svn*',
|
23
|
+
]
|
24
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Rake::Task['metrics:collect'].clear_actions
|
2
|
+
|
3
|
+
set :application, 'capistrano_with_rsync'
|
4
|
+
set :repo_url, 'https://github.com/linyows/capistrano-withrsync.git'
|
5
|
+
set :deploy_to, '/var/capistrano_with_rsync'
|
6
|
+
set :scm, :git
|
7
|
+
set :format, :pretty
|
8
|
+
set :log_level, :debug
|
data/spec/tid/id_rsa
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEpAIBAAKCAQEA54RVv3+XjUFcOJC5QD1wobIwkAAvicEz/Ihoq0lVhh3NTSv7
|
3
|
+
yyJl3XKq2KqnzYCln6TFXUiQES6IaeDf3usH55wKOnkgtuxmqn0Lq6aVV6Ly8gfT
|
4
|
+
4qOuKTAMfdQud2VT5vBRWIsxkxPog9Q60EWf99unCGB16wuMrGAPRwYwPQDVbBcW
|
5
|
+
lDR7VkksXsU1vww3ux599GbL6lT74HvzW862onwwmCqesefHr74Aii/5iRVTUBYY
|
6
|
+
be/pN1dm/F7tgT6nEkpdbzzRy6cy0zN/fzCR6FCds17p1q7ujbJz7hzzz3EJwFIu
|
7
|
+
bjtnnjAqOQDsRETkleM6RzwghJZHV/PsOq5HawIDAQABAoIBAQCeO5w/nfz+1kUp
|
8
|
+
hACZH2Tzns4CHZ5gEGRvnOus5hpF5+iBbiZR19i3Wb/bBghaNCr+yab68rVEiQFD
|
9
|
+
HCbmPMzSR5vWCyOI4lno/D4Vu20m0IArW549sJFAJU7kUTjQ8bg+htGSKtBfLaQl
|
10
|
+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4A7No52jQkDvHV0M2Ev5t1
|
25
|
+
H74LIInwkghw8qAOiOSzaFEyEJANDGX9998qTLMKpQF/iZ5cz86uIKsqGBN9sM28
|
26
|
+
zgAhOfA4IkTKAtDOWU9mH3ONet27Kx2acsansL5LU3evm+LE4M1Emg==
|
27
|
+
-----END RSA PRIVATE KEY-----
|
data/spec/tid/id_rsa.pub
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDnhFW/f5eNQVw4kLlAPXChsjCQAC+JwTP8iGirSVWGHc1NK/vLImXdcqrYqqfNgKWfpMVdSJARLohp4N/e6wfnnAo6eSC27GaqfQurppVXovLyB9Pio64pMAx91C53ZVPm8FFYizGTE+iD1DrQRZ/326cIYHXrC4ysYA9HBjA9ANVsFxaUNHtWSSxexTW/DDe7Hn30ZsvqVPvge/NbzraifDCYKp6x58evvgCKL/mJFVNQFhht7+k3V2b8Xu2BPqcSSl1vPNHLpzLTM39/MJHoUJ2zXunWru6NsnPuHPPPcQnAUi5uO2eeMCo5AOxEROSV4zpHPCCElkdX8+w6rkdr tomohisaoda@PMAC127S.local
|
data/wercker.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
box: wercker-labs/docker
|
2
|
+
build:
|
3
|
+
steps:
|
4
|
+
- install-packages:
|
5
|
+
packages: build-essential ruby2.0 ruby2.0-dev bundler
|
6
|
+
- script:
|
7
|
+
name: install latest docker
|
8
|
+
code: |
|
9
|
+
docker version
|
10
|
+
curl -s http://get.docker.io/ubuntu/ | sudo sh
|
11
|
+
docker version
|
12
|
+
- script:
|
13
|
+
name: chmod private key
|
14
|
+
code: chmod 600 ./spec/tid/id_rsa
|
15
|
+
- script:
|
16
|
+
name: create ssh config
|
17
|
+
code: |
|
18
|
+
echo "Host *" >> ~/.ssh/config
|
19
|
+
echo " StrictHostKeyChecking no" >> ~/.ssh/config
|
20
|
+
- bundle-install
|
21
|
+
- script:
|
22
|
+
name: rspec
|
23
|
+
code: bundle exec rspec
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-withrsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linyows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
+
- ".rspec"
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|
@@ -69,6 +70,16 @@ files:
|
|
69
70
|
- lib/capistrano/withrsync.rb
|
70
71
|
- lib/capistrano/withrsync/rake/task.rb
|
71
72
|
- lib/capistrano/withrsync/version.rb
|
73
|
+
- spec/feature_spec.rb
|
74
|
+
- spec/spec_helper.rb
|
75
|
+
- spec/tid/Capfile
|
76
|
+
- spec/tid/Dockerfile
|
77
|
+
- spec/tid/Gemfile
|
78
|
+
- spec/tid/config/deploy.rb
|
79
|
+
- spec/tid/config/deploy/test.rb
|
80
|
+
- spec/tid/id_rsa
|
81
|
+
- spec/tid/id_rsa.pub
|
82
|
+
- wercker.yml
|
72
83
|
homepage: https://github.com/linyows/capistrano-withrsync
|
73
84
|
licenses:
|
74
85
|
- MIT
|
@@ -89,8 +100,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
100
|
version: '0'
|
90
101
|
requirements: []
|
91
102
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.4.5
|
93
104
|
signing_key:
|
94
105
|
specification_version: 4
|
95
106
|
summary: Capistrano with rsync
|
96
|
-
test_files:
|
107
|
+
test_files:
|
108
|
+
- spec/feature_spec.rb
|
109
|
+
- spec/spec_helper.rb
|
110
|
+
- spec/tid/Capfile
|
111
|
+
- spec/tid/Dockerfile
|
112
|
+
- spec/tid/Gemfile
|
113
|
+
- spec/tid/config/deploy.rb
|
114
|
+
- spec/tid/config/deploy/test.rb
|
115
|
+
- spec/tid/id_rsa
|
116
|
+
- spec/tid/id_rsa.pub
|