pipedawg-vl 1.0.2 → 1.0.4

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8312b9b65c6fdcd02af00d8300d6dc97c9244bad0a5688882970c7de2e4a4301
4
- data.tar.gz: f6c315614e2913320660e8b3272eac8ed58858c432fe1c5a1f2f4aa13e1e6bf7
3
+ metadata.gz: 2bfe0bf6fb73e02b0ca5cb1715b9e23f98f8dced9902238942ca9bdb2913c1f6
4
+ data.tar.gz: 34c8434147a023e1aa12180730cb6027c5846fb6c587a4e0b345bbf594ed10a1
5
5
  SHA512:
6
- metadata.gz: c6d26b123e20f6f17eb9794e298c161770e4c2074958ecf568fd5cc5d27ab4fea75e50cf58e2d89cde52211412ea934f1b62a41226aac146be833fc363c394f4
7
- data.tar.gz: 7a41e5569f4ed442c0fc8169a67f9cb986be85cec4dcdb3507e3b6c7d97be13580e3649aa60efb2ccfd4007ab39195b22c84abf7d80fc6dcf31de39d276f9ffa
6
+ metadata.gz: 6f3e8ea639de3d0cd0d584145a9625c232de03e0de99f82a8fb6dc612d50554cf80da5ffc5906aa7193aa4e17ea5f472098d90a128dda1887862191efcd4f559
7
+ data.tar.gz: 26d3f2cfb3ffa1c35640ddf755fb052870b1a03e056ef6b00e08d806051b166c205fb2fbb7088eedc3c2a2d4122a2a9878cb4958bc26d5428ec43392ecd2ad97
@@ -7,7 +7,7 @@ module Pipedawg
7
7
  class Copy < Job::Skopeo
8
8
  def initialize(name, opts = {})
9
9
  opts = {
10
- config: {}, copy_image: name, destinations: [{ copy_image: nil, flags: [], options: {} }], flags: [],
10
+ config: {}, copy_image: name, destinations: [{ dest_image_name: nil, copy_image: nil, flags: [], options: {} }], flags: [],
11
11
  logins: {}, options: {}, stage: '${CI_PROJECT_DIR}/stage', trusted_ca_cert_source_files: [],
12
12
  trusted_ca_cert_target_file: '/etc/docker/certs.d/ca.crt'
13
13
  }.merge(opts)
@@ -18,7 +18,7 @@ module Pipedawg
18
18
  def update # rubocop:disable Metrics/AbcSize
19
19
  require 'json'
20
20
  opts[:script] = debug + config + cert_copies + login + mkstage + pull + (
21
- opts[:destinations].map { |d| push(d) }
21
+ opts[:destinations].map.with_index { |d, i| push(d, opts[:dest_image_names][i]) }
22
22
  ).flatten(1)
23
23
  end
24
24
 
@@ -37,13 +37,7 @@ module Pipedawg
37
37
 
38
38
  def login
39
39
  opts.fetch(:logins, {}).map do |k, v|
40
- begin
41
- command = "echo \"#{v['password']}\" | #{opts[:command]} login --authfile \"${CONFIG}/config.json\" --username \"#{v['username']}\" --password-stdin \"#{k}\"" # rubocop:disable Layout/LineLength
42
- `#{command}`
43
- puts "Login succeeded for #{k}"
44
- rescue RuntimeError => e
45
- puts "Login failed for #{k}: #{e.message}"
46
- end
40
+ "echo \"#{v['password']}\" | #{opts[:command]} login --authfile \"${CONFIG}/config.json\" --username \"#{v['username']}\" --password-stdin \"#{k}\" || echo \"Failed to login\"" # rubocop:disable Layout/LineLength
47
41
  end
48
42
  end
49
43
 
@@ -55,8 +49,8 @@ module Pipedawg
55
49
  copy(opts, "docker://#{opts[:copy_image]}", "\"dir://#{opts[:stage]}\"")
56
50
  end
57
51
 
58
- def push(destination_opts)
59
- copy(destination_opts, "\"dir://#{opts[:stage]}\"", "docker://#{destination_opts[:copy_image]}")
52
+ def push(destination_opts, dest_image_name)
53
+ copy(destination_opts, "\"dir://#{opts[:stage]}\"", "docker://#{dest_image_name || destination_opts[:copy_image]}")
60
54
  end
61
55
 
62
56
  def copy(copy_opts, source, destination)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pipedawg
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipedawg-vl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - harbottle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-17 00:00:00.000000000 Z
11
+ date: 2023-06-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Generate GitLab CI pipelines.
14
14
  email: