Class: MKIt::CreatePodSaga

Inherits:
ASaga
  • Object
show all
Includes:
DockerHelper
Defined in:
lib/mkit/sagas/create_pod_saga.rb

Instance Method Summary collapse

Methods included from DockerHelper

#attach_network, #clear_logs, #create_instance, #create_network, #create_volume, #delete_volume, #dettach_network, #execute_local, #inspect_instance, #inspect_volume, #logfile, #logs, #network_exists?, #remove_instance, #remove_network, #start_instance, #stop_instance, #to_docker_cpu_limit

Methods inherited from ASaga

#initialize

Constructor Details

This class inherits a constructor from MKIt::ASaga

Instance Method Details

#do_the(job) ⇒ Object

create_pod_saga:

payload:

* pod_name

triggers

* nothing


20
21
22
23
24
25
26
27
28
# File 'lib/mkit/sagas/create_pod_saga.rb', line 20

def do_the(job)
  MKItLogger.info("#{self.class} <#{job.topic}> #{job.inspect}....")

  pod_name = job.data['pod_name']
  pod = Pod.find_by_name(pod_name)
  docker_run = pod.parse
  MKItLogger.info("deploying docker pod, cmd [#{docker_run}]")
  create_instance(docker_run)
end

#topicsObject



7
8
9
# File 'lib/mkit/sagas/create_pod_saga.rb', line 7

def topics
  %w{create_pod_saga}
end