Class: Proxy::AnsibleDirector::Runners::PodmanPushRunner

Inherits:
Dynflow::Runner::Base
  • Object
show all
Includes:
Dynflow::Runner::ProcessManagerCommand
Defined in:
lib/smart_proxy_ansible_director/runners/podman_push_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(podman_push_input, suspended_action: nil) ⇒ PodmanPushRunner

Returns a new instance of PodmanPushRunner.



12
13
14
15
16
# File 'lib/smart_proxy_ansible_director/runners/podman_push_runner.rb', line 12

def initialize(podman_push_input, suspended_action: nil)
  super suspended_action: suspended_action
  puts podman_push_input
  @ee_id = podman_push_input[:ee_id]
end

Instance Method Details

#publish_data(message, type = 'debug') ⇒ Object



36
37
38
# File 'lib/smart_proxy_ansible_director/runners/podman_push_runner.rb', line 36

def publish_data(message, type = 'debug')
    @continuous_output.add_output(message.force_encoding('UTF-8'), type)
end

#refreshObject



30
31
32
33
34
# File 'lib/smart_proxy_ansible_director/runners/podman_push_runner.rb', line 30

def refresh
  @process_manager.process(timeout: 0.1) unless @process_manager.done?
  puts @continuous_output.humanize
  publish_exit_status(@process_manager.status) if @process_manager.done?
end

#startObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/smart_proxy_ansible_director/runners/podman_push_runner.rb', line 18

def start
  # TODO: Parametrize

  image_name = "ansible_director/#{@ee_id}:latest"
  registry = 'centos9-katello-devel-stable.example.com:4321'

  cmd = <<~CMD
    podman push --tls-verify=false #{image_name} #{registry}/#{image_name}
  CMD
  initialize_command('bash', '-c', cmd)
end