six-rsync 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six/rsync/lib.rb +15 -5
- data/lib/six/rsync.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/six/rsync/lib.rb
CHANGED
@@ -6,6 +6,9 @@
|
|
6
6
|
module Six
|
7
7
|
module Repositories
|
8
8
|
module Rsync
|
9
|
+
# TODO: Configure somewhere!
|
10
|
+
KEY = "C:/users/sb/documents/keys/id_rsa.ppk"
|
11
|
+
RSH = "-r --rsh=\"'#{File.join(BASE_PATH, "tools", "cygnative.exe")}' plink.exe -i #{KEY}\""
|
9
12
|
DIR_RSYNC = '.rsync'
|
10
13
|
DIR_PACK = File.join(DIR_RSYNC, '.pack')
|
11
14
|
REGEX_FOLDER = /(.*)[\\|\/](.*)/
|
@@ -132,6 +135,9 @@ module Six
|
|
132
135
|
arr_opts = []
|
133
136
|
arr_opts << PARAMS
|
134
137
|
arr_opts += x_opts
|
138
|
+
if host[/\A(\w)*\@/]
|
139
|
+
arr_opts << RSH#"-e ssh"
|
140
|
+
end
|
135
141
|
|
136
142
|
# TODO: UNCLUSTERFUCK
|
137
143
|
arr_opts << esc(File.join(host, '.pack/.'))
|
@@ -318,8 +324,8 @@ module Six
|
|
318
324
|
cmd = ''
|
319
325
|
save_repos(:local)
|
320
326
|
|
321
|
-
# TODO: Change to repositories.yml
|
322
327
|
host = config[:hosts].sample
|
328
|
+
|
323
329
|
verfile_srv = File.join(".pack", ".repository.yml")
|
324
330
|
begin
|
325
331
|
verbose = @verbose
|
@@ -359,7 +365,7 @@ module Six
|
|
359
365
|
|
360
366
|
# Upload .pack changes
|
361
367
|
if host[/\A(\w)*\@/]
|
362
|
-
arr_opts <<
|
368
|
+
arr_opts << RSH
|
363
369
|
end
|
364
370
|
arr_opts << esc(pack_path('.'))
|
365
371
|
arr_opts << esc(File.join(host, '.pack'))
|
@@ -397,6 +403,10 @@ module Six
|
|
397
403
|
@logger.info "Many files mismatched (#{mismatch.count}), running full update on .pack folder"
|
398
404
|
arr_opts = []
|
399
405
|
arr_opts << PARAMS
|
406
|
+
if host[/\A(\w)*\@/]
|
407
|
+
arr_opts << RSH
|
408
|
+
end
|
409
|
+
|
400
410
|
arr_opts << File.join(host, '.pack/.')
|
401
411
|
arr_opts << esc(pack_path)
|
402
412
|
|
@@ -524,7 +534,7 @@ module Six
|
|
524
534
|
arr_opts = []
|
525
535
|
arr_opts << PARAMS
|
526
536
|
if host[/\A(\w)*\@/]
|
527
|
-
arr_opts <<
|
537
|
+
arr_opts << RSH
|
528
538
|
end
|
529
539
|
arr_opts << esc(File.join(host, path))
|
530
540
|
arr_opts << esc(rsync_path(folder))
|
@@ -719,7 +729,7 @@ module Six
|
|
719
729
|
opts << "--stats" if @stats
|
720
730
|
|
721
731
|
opts = [opts].flatten.map {|s| s }.join(' ') # escape()
|
722
|
-
rsync_cmd = "rsync #{cmd} #{opts} #{redirect} 2>&1
|
732
|
+
rsync_cmd = "rsync #{cmd} #{opts} #{redirect}" # 2>&1
|
723
733
|
|
724
734
|
while rsync_cmd[WINDRIVE] do
|
725
735
|
drive = rsync_cmd[WINDRIVE]
|
@@ -779,7 +789,7 @@ module Six
|
|
779
789
|
#end
|
780
790
|
error = io_err.gets
|
781
791
|
if error
|
782
|
-
|
792
|
+
@logger.debug "Error: " + error.chomp
|
783
793
|
# exit
|
784
794
|
end
|
785
795
|
# puts "Result: " + io_out.gets
|
data/lib/six/rsync.rb
CHANGED
@@ -4,6 +4,7 @@ require 'fileutils'
|
|
4
4
|
require 'digest/md5'
|
5
5
|
require 'yaml'
|
6
6
|
|
7
|
+
BASE_PATH = Dir.pwd
|
7
8
|
require 'six/rsync/path'
|
8
9
|
require 'six/rsync/repository'
|
9
10
|
require 'six/rsync/working_directory'
|
@@ -29,7 +30,6 @@ module Six
|
|
29
30
|
|
30
31
|
module Rsync
|
31
32
|
VERSION = '0.1.1'
|
32
|
-
BASE_PATH = Dir.pwd
|
33
33
|
TOOLS_PATH = File.join(BASE_PATH, 'tools')
|
34
34
|
FOLDER = /(.*)\/(.*)/
|
35
35
|
ENV['PATH'] = ENV['PATH'] + ";#{TOOLS_PATH};#{File.join(TOOLS_PATH, 'bin')}"
|