docker-registry-sync 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTUwYjg1N2FmMjBmMzYyZjQ2OTJiNDZiY2ZjMWI2ZTFiOGRiNGVjYg==
4
+ NmE2Y2JjZmM2M2QxZTJjMjYwZWQ5NmQwZDQxY2UyOWIxNTdiMjNiMA==
5
5
  data.tar.gz: !binary |-
6
- MzhhYWY5OTkxMmNiMDczYTU3NjBhMjI3ZTg3MWVhZmMwZDYxNmFkMw==
6
+ NzVkZGU0YTcyNDY5MzEyMWI3NTQxYjI5OTU5MTg3ZWIxZmUwMTgyOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjNlYjg4OWYwNWM4MDM3ZmJkNjY3M2M3ZDk3OGUzOTZjMWZmYzQzYjUzNDQ1
10
- ZWNkYTk1MzMwMGYxM2IzOGQzOTEwODFhYWRmYjhlNGExMDNmZDliOTNhM2Zj
11
- ZWU5Y2YzZGQ2MTlkMGVmZGM2MzYzNjgyOTdmY2E3OWE0OTQ3ZTA=
9
+ Y2JlNTQ5Y2U1ZGI1OTg2OTJmMjkyM2RkYjJiZjMwNWQxYjljZDg3ZmM1YTJm
10
+ ZjBlZjQ4ODQ3NDcwODBhZTBmNmI5NGNjMThmMjc5ZmM0ZGNhNTA1YzMwMDA1
11
+ MWUyM2FhYjdmNTE1NGIwNzYyOTBmNzhjN2EwOTc4YjBhNTc2NjM=
12
12
  data.tar.gz: !binary |-
13
- ZmYxY2NjZTUyZjNjMGI0M2FmNDExZTU4MmM1NGM5MGZlMzczNTlmMmY0NjE3
14
- YzM1MzA1Y2M5Y2ExNTJlMjk3YTg3YWVmZmEzOTU2MmE1ZjAxNTgzYmQ1ZmZh
15
- NjYyNDk2N2IxMzNhMWRiYjk5MjNkMGM2ZDkxYWZiODUzYTcwZDk=
13
+ NzRkNmM3NDZiYmU0OTA1MTNkNDQxNWViYzY1YzE3NzU4ODZhMmY4NmY2YmVk
14
+ MzBlNGFhZTJiNWZhNjAxMDQ3NWUzMjYwNDlhNWNiYWEwZjgzMGI2MjllM2Fj
15
+ MTc1NTY3ZTRmYWE1NGQ5MjYxYTVkNWRjNmZkYTEyNjk4NWU5NzI=
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'optparse'
3
3
  require 'docker/registry/sync'
4
+ require 'aws-sdk'
4
5
 
5
6
  include Docker::Registry::Sync
6
7
 
@@ -63,13 +64,20 @@ if cmd.nil?
63
64
  end
64
65
 
65
66
  image = ARGV[1]
66
- if image.nil? && !['queue-sync', 'run-sync'].include?(cmd)
67
+ if image.nil? && 'run-sync' != cmd
67
68
  puts "Image and tag to sync must be supplied!\n\n"
68
69
  puts opt_parser
69
70
  exit 1
70
71
  end
71
72
 
72
73
  ENV['http_proxy'] = nil if options[:unset_proxy]
74
+ ENV['https_proxy'] = nil if options[:unset_proxy]
75
+ ENV['HTTP_PROXY'] = nil if options[:unset_proxy]
76
+ ENV['HTTPS_PROXY'] = nil if options[:unset_proxy]
77
+
78
+ if !(ENV['http_proxy'].nil? || options[:unset_proxy])
79
+ Aws.config[:http_proxy] = ENV['http_proxy']
80
+ end
73
81
 
74
82
  unless verify_opts(options, cmd)
75
83
  puts "Both '--source-bucket' and '--target-buckets' must be defined for 'sync' and 'queue-sync' commands\n"
@@ -10,9 +10,23 @@ module Docker
10
10
 
11
11
  class << self
12
12
  def configure(source_bucket, target_buckets, sqs_queue)
13
- source_region, source_bucket = source_bucket.split(':')
14
- target_buckets = target_buckets.split(',').collect { |bucket| bucket.split(':') }
15
- sqs_region, sqs_uri = sqs_queue.split(':')
13
+ unless source_bucket.nil?
14
+ source_region, source_bucket = source_bucket.split(':')
15
+ else
16
+ source_region, source_bucket = nil, nil
17
+ end
18
+
19
+ unless target_buckets.nil?
20
+ target_buckets = target_buckets.split(',').collect { |bucket| bucket.split(':') }
21
+ else
22
+ target_buckets = nil
23
+ end
24
+
25
+ unless sqs_queue.nil?
26
+ sqs_region, sqs_uri = sqs_queue.split(':')
27
+ else
28
+ sqs_region, sqs_uri = nil, nil
29
+ end
16
30
  Docker::Registry::Sync.configure do |config|
17
31
  config.source_bucket = source_bucket
18
32
  config.source_region = source_region
@@ -1,7 +1,7 @@
1
1
  module Docker
2
2
  module Registry
3
3
  module Sync
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-registry-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Oldfield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler