mina-rsync 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/lib/mina/rsync.rb +24 -23
- data/lib/mina/rsync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjJhYTZhMzUwMmVlNTk5NWI2N2MyMWUzMjc3MTUyMGI4ZmY1ODFlNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzgxZjNjYzFkYzg4ZWQ5MzdiMTJmODQ0NmE5OTMzOWU4MGE4OTczZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDY2MmI5NWFmN2FmZGQzMTM4MGE5MDM4MDBjYWRkMzQyOTQzNDcyNjRmZjkz
|
10
|
+
OGFiM2M1YjRiYTJiZTFhY2Q5NDg5ZGRmMDY5ZThiYWY5NGY5ZDNhZTg0ZWY2
|
11
|
+
ZWIyNWNmMGVkNjQ0Y2E2NTU3ZjM4MDdjNmIwZWQ0MmNmMDQyZmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDQ1NGY4ZTA4N2YzYjc5MzU0ZjgzMTdjMjhkNDc5NjhhNWE5Y2E0NzAyNTEy
|
14
|
+
YWU4ZDE4Yjc5YzRlODE1YWY4YWMyMmIxNGE0NmE2MDRlODU3ZWRlZTNlYjg1
|
15
|
+
ZWY2OWYxZDFmMDFmNjZlZTc3YTJkYmViZTA1MjJiMGMwYTNhYTI=
|
data/CHANGELOG.md
CHANGED
data/lib/mina/rsync.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require File.expand_path("../rsync/version", __FILE__)
|
2
2
|
|
3
|
-
# NOTE: Please don't depend on tasks without a description (`desc`)
|
4
|
-
#
|
5
|
-
# API and
|
6
|
-
# for extending, please let me know!
|
3
|
+
# NOTE: Please don't depend on tasks without a description (`desc`) as they
|
4
|
+
# might change between minor or patch version releases. They make up the
|
5
|
+
# private API and internals of Mina::Rsync. If you think something should be
|
6
|
+
# public for extending and hooking, please let me know!
|
7
7
|
|
8
8
|
set_default :repository, "."
|
9
9
|
set_default :branch, "master"
|
@@ -18,11 +18,9 @@ set_default :rsync_stage, "tmp/deploy"
|
|
18
18
|
set_default :rsync_cache, "shared/deploy"
|
19
19
|
|
20
20
|
run = lambda do |*cmd|
|
21
|
-
if
|
22
|
-
|
23
|
-
|
24
|
-
Kernel.system *cmd
|
25
|
-
end
|
21
|
+
cmd = cmd[0] if cmd[0].is_a?(Array)
|
22
|
+
print_command cmd.join(" ") if simulate_mode? || verbose_mode?
|
23
|
+
Kernel.system *cmd unless simulate_mode?
|
26
24
|
end
|
27
25
|
|
28
26
|
rsync_cache = lambda do
|
@@ -34,7 +32,7 @@ end
|
|
34
32
|
|
35
33
|
desc "Stage and rsync to the server (or its cache)."
|
36
34
|
task :rsync => %w[rsync:stage] do
|
37
|
-
|
35
|
+
print_status "Rsyncing to #{rsync_cache.call}..."
|
38
36
|
|
39
37
|
rsync = %w[rsync]
|
40
38
|
rsync.concat settings.rsync_options
|
@@ -44,34 +42,37 @@ task :rsync => %w[rsync:stage] do
|
|
44
42
|
host = settings.domain
|
45
43
|
rsync << "#{user}#{host}:#{rsync_cache.call}"
|
46
44
|
|
47
|
-
run.call
|
45
|
+
run.call rsync
|
48
46
|
end
|
49
47
|
|
50
48
|
namespace :rsync do
|
51
49
|
task :create_stage do
|
52
50
|
next if File.directory?(settings.rsync_stage)
|
53
|
-
|
51
|
+
print_status "Cloning repository for the first time..."
|
54
52
|
|
55
|
-
clone = %
|
53
|
+
clone = %w[git clone]
|
56
54
|
clone << settings.repository
|
57
55
|
clone << settings.rsync_stage
|
58
|
-
run.call
|
56
|
+
run.call clone
|
59
57
|
end
|
60
58
|
|
61
59
|
desc "Stage the repository in a local directory."
|
62
60
|
task :stage => %w[create_stage] do
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
print_status "Staging..."
|
62
|
+
|
63
|
+
stage = settings.rsync_stage
|
64
|
+
git = %W[git --git-dir #{stage}/.git --work-tree #{stage}]
|
65
|
+
run.call git + %w[fetch --quiet --all --prune]
|
66
|
+
|
67
|
+
# Prefix the Git "HEAD is now at" message, but only if verbose is unset,
|
68
|
+
# because then the #print_command called by #run prints its own prefix.
|
69
|
+
print "Git checkout: " unless simulate_mode? || verbose_mode?
|
70
|
+
run.call git + %W[reset --hard origin/#{settings.branch}]
|
71
71
|
end
|
72
72
|
|
73
73
|
task :build do
|
74
|
-
queue %(
|
74
|
+
queue %(echo "-> Copying from cache directory to build path")
|
75
|
+
queue! %(#{settings.rsync_copy} "#{rsync_cache.call}/" ".")
|
75
76
|
end
|
76
77
|
|
77
78
|
desc "Stage, rsync and copy to the build path."
|
data/lib/mina/rsync/version.rb
CHANGED