Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 4c60ce57f49..2f04d99f9f6 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -8,6 +8,7 @@ class Deployment < ApplicationRecord
include Importable
include Gitlab::Utils::StrongMemoize
include FastDestroyAll
+ include FromUnion
StatusUpdateError = Class.new(StandardError)
StatusSyncError = Class.new(StandardError)
@@ -69,6 +70,10 @@ class Deployment < ApplicationRecord
transition created: :blocked
end
+ event :unblock do
+ transition blocked: :created
+ end
+
event :succeed do
transition any - [:success] => :success
end
@@ -107,10 +112,7 @@ class Deployment < ApplicationRecord
deployment.run_after_commit do
Deployments::UpdateEnvironmentWorker.perform_async(id)
Deployments::LinkMergeRequestWorker.perform_async(id)
-
- if ::Feature.enabled?(:deployments_archive, deployment.project, default_enabled: :yaml)
- Deployments::ArchiveInProjectWorker.perform_async(deployment.project_id)
- end
+ Deployments::ArchiveInProjectWorker.perform_async(deployment.project_id)
end
end