Class: UffizziCore::Deployment::DeployContainersJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/uffizzi_core/deployment/deploy_containers_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(id, repeated = false) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/jobs/uffizzi_core/deployment/deploy_containers_job.rb', line 14

def perform(id, repeated = false)
  Rails.logger.info("DEPLOYMENT_PROCESS deployment_id=#{id} DeployContainersJob")

  deployment = UffizziCore::Deployment.find(id)
  if deployment.disabled?
    Rails.logger.info("DEPLOYMENT_PROCESS deployment_id=#{deployment.id} deployment was disabled stop deploying")
    return
  end

  raise UffizziCore::DeploymentNotFoundError, id unless UffizziCore::ControllerService.deployment_exists?(deployment)

  UffizziCore::DeploymentService.deploy_containers(deployment, repeated)
end