docker-spec 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 468199d42b57545252219d5bfc7a48058921d0d4
4
- data.tar.gz: eb3cb666a50cb71cd9551b469566befa7ca94ace
3
+ metadata.gz: e463ce0c2f1b3802ab6a42ade137035f01caecb9
4
+ data.tar.gz: 942786454991860269938b07868824a1163b9e68
5
5
  SHA512:
6
- metadata.gz: '02689083df095e8cfaf77fce4bb20654454d254dcf00fba5e6af53e2e1b4bec41b570f87f8618e8ea7b3137e312e174cdbd16fe69f0963c1cee44c495521681f'
7
- data.tar.gz: 32017eb0ed2de213c6fccd88091f82be2e536a9386dede6fc13c9acfbac2240855252c7ab4c780b3695f3c05da91096dd6bd32cf22f652ca8ebd5211dac47328
6
+ metadata.gz: fa210d810572141b7bcb020199ffe1849047ab2ede958384636f6572e95f07ae6cb7066b877c771bd9af9dbcef0c9596c9ec579e4353d02e0ca6fbedef157d43
7
+ data.tar.gz: 0f478a7f1b1d27417f2d58b8312c7b392037c994f2ed58fbb16670bf9effa7efd509f4a4ab84ebfb8cd4ed45030e97e5c597d6a00544ff99e28f128878f8d2e6
data/README.md CHANGED
@@ -27,6 +27,22 @@ require 'docker-spec'
27
27
 
28
28
  And run rspec to build your docker containers
29
29
 
30
+ ## Options are
31
+
32
+ :build_root: wether to build the root directory or not
33
+ :build_root: wether to build the docker image
34
+ :push_container: if the container should be pushed
35
+ :account: can be the registry URL or the dockerhub account name
36
+ :name: the docker image / repository name
37
+ :auth: the auth key used to authenticate if is not dockerhub on ~/.docker/config.js
38
+ :serveraddress: The server address to authenticate to if not dockerhub
39
+ :tag_db: The file where to update the tag information
40
+ :env: an array of VAR=foo environment variables to pass when running
41
+ :registry: -> registry credentials
42
+ :username:
43
+ :password:
44
+ :email:
45
+
30
46
  ## Contributing
31
47
 
32
48
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/docker-spec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
@@ -35,4 +51,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
35
51
 
36
52
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
37
53
 
38
- # TODO: Finish the integration with push
@@ -56,20 +56,21 @@ class DockerSpec
56
56
  fail('tag_db is not defined in docker_spec.yml')
57
57
 
58
58
  # Load credentials from config file, or default docker config
59
- if @config[:dockerhub]
60
- @config[:dockerhub][:username] ||
61
- fail('dockerhub->username is not defined in docker_spec.yml')
62
- @config[:dockerhub][:password] ||
63
- fail('dockerhub->password is not defined in docker_spec.yml')
64
- @config[:dockerhub][:email] ||
65
- fail('dockerhub->email is not defined in docker_spec.yml')
59
+ if @config[:registry]
60
+ @config[:registry][:username] ||
61
+ fail('registry->username is not defined in docker_spec.yml')
62
+ @config[:registry][:password] ||
63
+ fail('registry->password is not defined in docker_spec.yml')
64
+ @config[:registry][:email] ||
65
+ fail('registry->email is not defined in docker_spec.yml')
66
66
  else
67
- @config[:dockerhub] = Hash.new
67
+ auth = @config[:auth] || 'https://index.docker.io/v1/'
68
+ @config[:registry] = Hash.new
68
69
  docker_auth = JSON.parse(File.read(File.expand_path(DOCKER_AUTH_FILE)))
69
- auth_base64 = docker_auth['auths']['https://index.docker.io/v1/']['auth']
70
- @config[:dockerhub][:username] = Base64.decode64(auth_base64).split(':').first
71
- @config[:dockerhub][:password] = Base64.decode64(auth_base64).split(':').last
72
- @config[:dockerhub][:email] = docker_auth['auths']['https://index.docker.io/v1/']['email']
70
+ auth_base64 = docker_auth['auths'][auth]['auth']
71
+ @config[:registry][:username] = Base64.decode64(auth_base64).split(':').first
72
+ @config[:registry][:password] = Base64.decode64(auth_base64).split(':').last
73
+ @config[:registry][:email] = docker_auth['auths'][auth]['email']
73
74
  end
74
75
 
75
76
  # Open key value store and get the current tag for this repo
@@ -82,9 +83,10 @@ class DockerSpec
82
83
  end
83
84
 
84
85
  # Login to docker hub and push latest and new_tag
85
- Docker.authenticate! username: @config[:dockerhub][:username],
86
- password: @config[:dockerhub][:password],
87
- email: @config[:dockerhub][:email]
86
+ Docker.authenticate! username: @config[:registry][:username],
87
+ password: @config[:registry][:password],
88
+ email: @config[:registry][:email],
89
+ serveraddress: @config[:serveraddress] || 'https://index.docker.io'
88
90
 
89
91
  image.tag repo: @config[:image_name], tag: new_tag, force: true
90
92
  puts "\nINFO: pushing #{@config[:image_name]}:#{new_tag} to DockerHub"
@@ -1,5 +1,5 @@
1
1
  module Docker
2
2
  module Spec
3
- VERSION = "0.16.0"
3
+ VERSION = "0.17.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Breinlinger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-15 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler