docker-sync 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/docker-sync/dependencies/docker_driver.rb +1 -1
- data/lib/docker-sync/sync_strategy/native_osx.rb +11 -1
- data/lib/docker-sync/sync_strategy/rsync.rb +1 -1
- data/lib/docker-sync/sync_strategy/unison.rb +7 -6
- data/tasks/sync/sync.thor +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb070a930f4ed696ff77d215964bc8b072befa4e
|
4
|
+
data.tar.gz: b28aa8a79ce842c345616df3a7c036a106c6a9a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fea6207b55d99adf4f400ea6feff7ddd3a261487bbf9e656c03026d8cb34c011883c57f24045de8358248071e9407d9d31485d6e0a1cd72e02f808c7e3fea7a
|
7
|
+
data.tar.gz: 7905e062de45685bc43bb98863aba020c37fe80bbd8d04b02cd8ebc9047ee679ab6d9d9c4dc16c5c0b3f57ffdca482892de74e168d2bfdf641efefe376db5be2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|
@@ -5,7 +5,7 @@ module DockerSync
|
|
5
5
|
def self.docker_for_mac?
|
6
6
|
return false unless Environment.mac?
|
7
7
|
return @docker_for_mac if defined? @docker_for_mac
|
8
|
-
@docker_for_mac = system('
|
8
|
+
@docker_for_mac = system('pgrep -q com.docker.hyperkit')
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.docker_toolbox?
|
@@ -23,7 +23,7 @@ module DockerSync
|
|
23
23
|
if @options.key?('image')
|
24
24
|
@docker_image = @options['image']
|
25
25
|
else
|
26
|
-
@docker_image = 'eugenmayer/unison:hostsync_0.
|
26
|
+
@docker_image = 'eugenmayer/unison:hostsync_0.3'
|
27
27
|
end
|
28
28
|
|
29
29
|
# TODO: remove this when we have a more stable image, but for now, we need this
|
@@ -65,6 +65,16 @@ module DockerSync
|
|
65
65
|
env['OWNER_UID'] = @options['sync_userid'] if @options.key?('sync_userid')
|
66
66
|
end
|
67
67
|
|
68
|
+
monit_options = {
|
69
|
+
monit_enable: 'MONIT_ENABLE',
|
70
|
+
monit_interval: 'MONIT_INTERVAL',
|
71
|
+
monit_high_cpu_cycles: 'MONIT_HIGH_CPU_CYCLES',
|
72
|
+
}
|
73
|
+
|
74
|
+
monit_options.each do |key, env_key|
|
75
|
+
env[env_key] = @options[key.to_s] if @options.key?(key.to_s)
|
76
|
+
end
|
77
|
+
|
68
78
|
host_disk_mount_mode = '' # see https://github.com/moby/moby/pull/31047
|
69
79
|
host_disk_mount_mode = ":#{@options['host_disk_mount_mode']}" if @options.key?('host_disk_mount_mode')
|
70
80
|
|
@@ -135,7 +135,7 @@ module DockerSync
|
|
135
135
|
def get_docker_env
|
136
136
|
env_mapping = []
|
137
137
|
env_mapping << "-e VOLUME=#{@options['dest']}"
|
138
|
-
env_mapping << "-e TZ=$
|
138
|
+
env_mapping << "-e TZ=$(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`)"
|
139
139
|
env_mapping << "-e ALLOW=#{@options['sync_host_allow']}" if @options['sync_host_allow']
|
140
140
|
env_mapping.join(' ')
|
141
141
|
end
|
@@ -22,7 +22,7 @@ module DockerSync
|
|
22
22
|
if @options.key?('image')
|
23
23
|
@docker_image = @options['image']
|
24
24
|
else
|
25
|
-
@docker_image = 'eugenmayer/unison'
|
25
|
+
@docker_image = 'eugenmayer/unison:0.3'
|
26
26
|
end
|
27
27
|
begin
|
28
28
|
Dependencies::Unison.ensure!
|
@@ -119,10 +119,11 @@ module DockerSync
|
|
119
119
|
args.push("'#{@options['src']}'")
|
120
120
|
args.push('-auto')
|
121
121
|
args.push('-batch')
|
122
|
-
args.push(sync_prefer)
|
123
|
-
args.push(@options['sync_args']) if @options.key?('sync_args')
|
124
122
|
sync_host_port = get_host_port(get_container_name, UNISON_CONTAINER_PORT)
|
125
|
-
|
123
|
+
dest = "socket://#{@options['sync_host_ip']}:#{sync_host_port}"
|
124
|
+
args.push(sync_prefer(dest))
|
125
|
+
args.push(@options['sync_args']) if @options.key?('sync_args')
|
126
|
+
args.push(dest)
|
126
127
|
|
127
128
|
if @options.key?('sync_group') || @options.key?('sync_groupid')
|
128
129
|
raise('Unison does not support sync_group, sync_groupid - please use rsync if you need that')
|
@@ -131,11 +132,11 @@ module DockerSync
|
|
131
132
|
end
|
132
133
|
|
133
134
|
# cares about conflict resolution
|
134
|
-
def sync_prefer
|
135
|
+
def sync_prefer dest
|
135
136
|
case @options.fetch('sync_prefer', 'default')
|
136
137
|
when 'default' then "-prefer '#{@options['src']}' -copyonconflict" # thats our default, if nothing is set
|
137
138
|
when 'src' then "-prefer '#{@options['src']}'"
|
138
|
-
when 'dest' then "-prefer '#{
|
139
|
+
when 'dest' then "-prefer '#{dest}'"
|
139
140
|
else "-prefer '#{@options['sync_prefer']}'"
|
140
141
|
end
|
141
142
|
end
|
data/tasks/sync/sync.thor
CHANGED
@@ -22,7 +22,7 @@ class Sync < Thor
|
|
22
22
|
|
23
23
|
desc 'start', 'Start all sync configurations in this project'
|
24
24
|
method_option :daemon, :aliases => '-d', :default => false, :type => :boolean, :desc => 'Run in the background'
|
25
|
-
method_option :foreground, :aliases => '-
|
25
|
+
method_option :foreground, :aliases => '-f', :default => false, :type => :boolean, :desc => 'Run in the foreground'
|
26
26
|
method_option :app_name, :aliases => '--name', :default => 'daemon', :type => :string, :desc => 'App name used in PID and OUTPUT file name for Daemon'
|
27
27
|
method_option :dir, :aliases => '--dir', :default => './.docker-sync', :type => :string, :desc => 'Path to PID and OUTPUT file Directory'
|
28
28
|
method_option :logd, :aliases => '--logd', :default => true, :type => :boolean, :desc => 'To log OUPUT to file on Daemon or not'
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugen Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|