Class: UffizziCore::Deployment

Inherits:
ApplicationRecord show all
Extended by:
Enumerize
Includes:
AASM, DeploymentRepo, StateMachineConcern
Defined in:
app/models/uffizzi_core/deployment.rb

Defined Under Namespace

Classes: CreateCredentialJob, CreateCredentialsJob, CreateJob, CreateWebhooksJob, DeleteCredentialJob, DeleteJob, DeployContainersJob, ImagePullError, ManageDeployActivityItemJob

Instance Method Summary collapse

Instance Method Details

#active_containersObject



52
53
54
# File 'app/models/uffizzi_core/deployment.rb', line 52

def active_containers
  containers.active
end

#after_disableObject



74
75
76
# File 'app/models/uffizzi_core/deployment.rb', line 74

def after_disable
  clean
end

#after_failObject



78
79
80
# File 'app/models/uffizzi_core/deployment.rb', line 78

def after_fail
  active_containers.each(&:disable!)
end

#cleanObject



82
83
84
85
# File 'app/models/uffizzi_core/deployment.rb', line 82

def clean
  active_containers.each(&:disable!)
  UffizziCore::Deployment::DeleteJob.perform_async(id)
end