retag 0.1.0.73710 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/retag/image.rb +5 -3
- data/lib/retag/service.rb +4 -3
- data/lib/retag/utils.rb +1 -1
- data/lib/retag/version.rb +1 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91558c109a6f2bf1cc988a0bf375404ca035c229d0abd031fd52cbe084cc1d23
|
4
|
+
data.tar.gz: be5c10c2e9d85588f412b81c92fb22dfcac5117360e47c9bd20eb02d8219f992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3093e65db866569cc3a28ffc09ce9b97241d6fb7c3e4793ff880e24a521b83bc4861ee172a27ef8d7e99d71c639da30fbbff7614574712bc5804525f48d5bd68
|
7
|
+
data.tar.gz: 7381e35cc1934e8a78e9a4514a8f6dd3863e3744c5f516c083ccd88255dbe2b25b4eba111f69430fc1b91d8d80e98923d19c3cb298379404f7f268555efd3419
|
data/lib/retag/image.rb
CHANGED
@@ -10,8 +10,8 @@ module Retag
|
|
10
10
|
def initialize(image, tag, suffix: nil)
|
11
11
|
@image = image
|
12
12
|
@tag = tag
|
13
|
-
@tag = "#{tag}-#{suffix}" if suffix.present?
|
14
|
-
@full = "#{image}:#{tag}"
|
13
|
+
@tag = "#{@tag}-#{suffix}" if suffix.present?
|
14
|
+
@full = "#{@image}:#{@tag}"
|
15
15
|
end
|
16
16
|
|
17
17
|
def retag!(newtag = tag)
|
@@ -24,13 +24,15 @@ module Retag
|
|
24
24
|
|
25
25
|
Tempfile.create('manifest') do |file|
|
26
26
|
manifest = JSON.parse(cmd!("curl -s -u '#{dockerauth(uri.host)}' -H 'Accept: #{content_type}' '#{uri}/v2/#{repo}/manifests/#{tag}' -o -", capture: true).strip)
|
27
|
-
raise manifest unless manifest.dig('layers') || manifest.dig('config')
|
27
|
+
raise manifest.inspect unless manifest.dig('layers') || manifest.dig('config')
|
28
28
|
|
29
29
|
file.write(manifest.to_json)
|
30
30
|
file.flush
|
31
31
|
result = cmd!("curl -s -u '#{dockerauth(uri.host)}' -H 'Content-Type: #{content_type}' -H 'Accept: #{content_type}' -X PUT --data-binary @#{file.path} '#{uri}/v2/#{repo}/manifests/#{newtag}' -o -", capture: true).strip
|
32
32
|
raise result unless result.empty?
|
33
33
|
end
|
34
|
+
|
35
|
+
Image.new(image, newtag)
|
34
36
|
end
|
35
37
|
|
36
38
|
def pull(img = full)
|
data/lib/retag/service.rb
CHANGED
@@ -3,18 +3,19 @@ module Retag
|
|
3
3
|
|
4
4
|
include Retag::Utils
|
5
5
|
|
6
|
-
attr_reader :name, :config, :repo, :branch, :release
|
6
|
+
attr_reader :name, :config, :repo, :branch, :release, :suffix
|
7
7
|
|
8
|
-
def initialize(name, config, release)
|
8
|
+
def initialize(name, config, release, suffix: )
|
9
9
|
@name = name
|
10
10
|
@config = config
|
11
11
|
@repo = config['repo']
|
12
12
|
@branch = config['branch']
|
13
13
|
@release = release
|
14
|
+
@suffix = suffix
|
14
15
|
end
|
15
16
|
|
16
17
|
def images
|
17
|
-
@images ||= config['images'].map{|img| Retag::Image.new(img, revision, suffix:
|
18
|
+
@images ||= config['images'].map{|img| Retag::Image.new(img, revision, suffix: @suffix) }
|
18
19
|
end
|
19
20
|
|
20
21
|
def pull
|
data/lib/retag/utils.rb
CHANGED
@@ -10,7 +10,7 @@ module Retag
|
|
10
10
|
tag = $cmdnum.to_s.rjust(3, '0')
|
11
11
|
output = ''
|
12
12
|
|
13
|
-
logger.tagged("CMD#{tag}") { logger.debug cmd }
|
13
|
+
logger.tagged("CMD#{tag}".colorize(:light_black)) { logger.debug cmd.colorize(:light_black) }
|
14
14
|
|
15
15
|
code = Open3.popen3(cmd) do |stdin, stdout, stderr, thr|
|
16
16
|
stdin.close_write
|
data/lib/retag/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2022-01-20 00:00:00.000000000 Z
|
@@ -142,6 +142,20 @@ dependencies:
|
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '6.0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: colorize
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
type: :runtime
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
145
159
|
- !ruby/object:Gem::Dependency
|
146
160
|
name: json
|
147
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,7 +233,7 @@ licenses:
|
|
219
233
|
metadata:
|
220
234
|
homepage_uri: https://github.com/RnD-Soft/retag
|
221
235
|
source_code_uri: https://github.com/RnD-Soft/retag
|
222
|
-
post_install_message:
|
236
|
+
post_install_message:
|
223
237
|
rdoc_options: []
|
224
238
|
require_paths:
|
225
239
|
- lib
|
@@ -234,8 +248,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
248
|
- !ruby/object:Gem::Version
|
235
249
|
version: '0'
|
236
250
|
requirements: []
|
237
|
-
rubygems_version: 3.
|
238
|
-
signing_key:
|
251
|
+
rubygems_version: 3.2.28
|
252
|
+
signing_key:
|
239
253
|
specification_version: 4
|
240
254
|
summary: Retag is cli to manipulate docker images in handy way
|
241
255
|
test_files: []
|