Class: Pipedawg::Job::Skopeo::Copy

Inherits:
Pipedawg::Job::Skopeo show all
Defined in:
lib/pipedawg/job/skopeo/copy.rb

Overview

Pipedawg::Job::Skopeo::Copy class

Instance Attribute Summary

Attributes inherited from Pipedawg::Job

#name, #opts

Instance Method Summary collapse

Methods inherited from Pipedawg::Job

#to_hash

Constructor Details

#initialize(name, opts = {}) ⇒ Copy

Returns a new instance of Copy.



8
9
10
11
12
13
14
15
16
# File 'lib/pipedawg/job/skopeo/copy.rb', line 8

def initialize(name, opts = {})
  opts = {
    config: {}, copy_image: name, destinations: [{ copy_image: nil, flags: [], options: {} }], flags: [],
    logins: {}, options: {}, stage: '${CI_PROJECT_DIR}/stage', trusted_ca_cert_source_files: [],
    trusted_ca_cert_target_file: '/etc/docker/certs.d/ca.crt'
  }.merge(opts)
  super name, opts
  update
end

Instance Method Details

#updateObject

rubocop:disable Metrics/AbcSize



18
19
20
21
22
23
# File 'lib/pipedawg/job/skopeo/copy.rb', line 18

def update # rubocop:disable Metrics/AbcSize
  require 'json'
  opts[:script] = debug + config + cert_copies +  + mkstage + pull + (
    opts[:destinations].map { |d| push(d) }
  ).flatten(1)
end