docker-sync 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/VERSION +1 -1
- data/lib/docker-sync/dependencies.rb +8 -1
- data/lib/docker-sync/dependencies/docker.rb +1 -1
- data/lib/docker-sync/dependencies/unox.rb +1 -1
- data/lib/docker-sync/sync_strategy/rsync.rb +17 -2
- data/lib/docker-sync/update_check.rb +1 -15
- data/lib/docker-sync/watch_strategy/fswatch.rb +11 -6
- data/lib/docker-sync/watch_strategy/unison.rb +5 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ecc935b13c597ecb9e2beaf3a75881c58d5c386d6df3e937cdb07b15ccee88d7
|
4
|
+
data.tar.gz: 381e33ab0456a9974c31128de0603ae15e1f566d901f260783bc6acc79be75ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec25c5c03c77cea81f99cafa27457063033b2d077942864e6c8d8962c83958046016c20392bced7204ef8c3dabfe20236180d77145f51cbfdcd228b39712e4b
|
7
|
+
data.tar.gz: b0281a5d8449aa08b0e3bd3fd1829c6a54cb41495fe61ca5f6b9d48ac857e79631a582b9fa15a7eec347176f3a8aab5e8c7e7b508eca852551babfd5f1c6c364
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.8
|
@@ -23,7 +23,14 @@ module DockerSync
|
|
23
23
|
Docker.ensure!
|
24
24
|
Unison.ensure! if config.unison_required?
|
25
25
|
Rsync.ensure! if config.rsync_required?
|
26
|
-
|
26
|
+
if config.fswatch_required?
|
27
|
+
unless Fswatch.available?
|
28
|
+
Fswatch.ensure!
|
29
|
+
puts "please restart docker sync so the installation of fswatch takes effect"
|
30
|
+
raise(UNSUPPORTED_OPERATING_SYSTEM)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
27
34
|
end
|
28
35
|
|
29
36
|
def self.ensure_all_for_linux!(_config)
|
@@ -71,6 +71,21 @@ module DockerSync
|
|
71
71
|
return args
|
72
72
|
end
|
73
73
|
|
74
|
+
# sleep until rsync --dry-run succeeds in connecting to the daemon on the configured IP and port.
|
75
|
+
def health_check
|
76
|
+
health_check_cmd = "rsync --dry-run rsync://#{@options['sync_host_ip']}:#{@options['sync_host_port']}:: 2> /dev/null"
|
77
|
+
|
78
|
+
retry_counter = 0
|
79
|
+
|
80
|
+
health_check_status = `#{health_check_cmd}`
|
81
|
+
while health_check_status == '' && retry_counter < 10 do
|
82
|
+
say_status 'ok', "waiting for rsync daemon on rsync://#{@options['sync_host_ip']}:#{@options['sync_host_port']}", :white if @options['verbose']
|
83
|
+
retry_counter += 1
|
84
|
+
health_check_status = `#{health_check_cmd}`
|
85
|
+
sleep 1
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
74
89
|
def get_container_name
|
75
90
|
return "#{@sync_name}"
|
76
91
|
end
|
@@ -109,8 +124,8 @@ module DockerSync
|
|
109
124
|
say_status 'ok', "#{container_name} container still running", :blue if @options['verbose']
|
110
125
|
end
|
111
126
|
say_status 'ok', "#{container_name}: starting initial sync of #{@options['src']}", :white if @options['verbose']
|
112
|
-
|
113
|
-
|
127
|
+
|
128
|
+
health_check
|
114
129
|
sync
|
115
130
|
say_status 'success', 'Rsync server started', :green
|
116
131
|
end
|
@@ -70,20 +70,6 @@ class UpdateChecker
|
|
70
70
|
|
71
71
|
end
|
72
72
|
|
73
|
-
def check_unison_image
|
74
|
-
return # we do not need this anymore since we use versioned ( tagged ) images and they will be pulled autoamtically if they are missing
|
75
|
-
return if ENV['DOCKER_SYNC_SKIP_UPDATE']
|
76
|
-
say_status 'ok','Checking if a newer unison image is available'
|
77
|
-
|
78
|
-
if system("docker pull eugenmayer/unison:2.51.2.1 | grep 'Downloaded newer image for'")
|
79
|
-
say_status 'ok', 'Downloaded newer image for unison', :green
|
80
|
-
@newer_image_found = true
|
81
|
-
else
|
82
|
-
say_status 'ok', 'No newer image found - current image is up to date.'
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
86
|
-
|
87
73
|
def get_current_version
|
88
74
|
path = File.expand_path('../../../', __FILE__)
|
89
75
|
version = File.read("#{path}/VERSION")
|
@@ -103,7 +89,7 @@ class UpdateChecker
|
|
103
89
|
# update the timestamp
|
104
90
|
@config.update! 'update_last_check' => DateTime.now.iso8601(9)
|
105
91
|
|
106
|
-
check =
|
92
|
+
check = docker_sync_update_check7
|
107
93
|
if check.update_available
|
108
94
|
say_status 'warning',"There is an update (#{check.latest_version}) available (current version #{check.current_version}). Please update before you continue",:yellow
|
109
95
|
if yes?("Shall I update docker-sync to #{check.latest_version} for you?")
|
@@ -17,12 +17,17 @@ module DockerSync
|
|
17
17
|
@options = options
|
18
18
|
@events_to_watch = %w(AttributeModified Created Link MovedFrom MovedTo Renamed Removed Updated)
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
unless Dependencies::Fswatch.available?
|
21
|
+
begin
|
22
|
+
Dependencies::Fswatch.ensure!
|
23
|
+
rescue StandardError => e
|
24
|
+
say_status 'error', e.message, :red
|
25
|
+
exit 1
|
26
|
+
end
|
27
|
+
puts "please restart docker sync so the installation of fswatch takes effect"
|
28
|
+
raise(UNSUPPORTED_OPERATING_SYSTEM)
|
29
|
+
end
|
30
|
+
|
26
31
|
end
|
27
32
|
|
28
33
|
def run
|
@@ -27,8 +27,11 @@ module DockerSync
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def stop
|
30
|
-
|
31
|
-
|
30
|
+
# Make sure @watch_fork is not nil otherwise a TypeError is thrown
|
31
|
+
if @watch_fork
|
32
|
+
Process.kill 'TERM', @watch_fork
|
33
|
+
Process.wait @watch_fork
|
34
|
+
end
|
32
35
|
end
|
33
36
|
|
34
37
|
def clean
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugen Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
version: '0'
|
226
226
|
requirements: []
|
227
227
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.
|
228
|
+
rubygems_version: 2.7.6
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: Docker Sync - Fast and efficient way to sync code to docker-containers
|