docker-spec 0.16.0 → 0.17.0
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 +4 -4
- data/README.md +16 -1
- data/lib/docker/spec.rb +17 -15
- data/lib/docker/spec/version.rb +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: e463ce0c2f1b3802ab6a42ade137035f01caecb9
|
4
|
+
data.tar.gz: 942786454991860269938b07868824a1163b9e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/docker/spec.rb
CHANGED
@@ -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[:
|
60
|
-
@config[:
|
61
|
-
fail('
|
62
|
-
@config[:
|
63
|
-
fail('
|
64
|
-
@config[:
|
65
|
-
fail('
|
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[:
|
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'][
|
70
|
-
@config[:
|
71
|
-
@config[:
|
72
|
-
@config[:
|
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[:
|
86
|
-
password: @config[:
|
87
|
-
email: @config[:
|
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"
|
data/lib/docker/spec/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|