blob: 8b2ad6b8e5b4e3180269c11eb6c8d4ab64fd4432 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
module Gitlab
module Ci
module Status
module Deployment
class Success < Status::Extended
def environment_text_for_pipeline
if subject.last?
"Successfully deployed to %{environment_path}."
else
"Outdated deployment to %{environment_path}. View the most recent deployment %{deployment_path}."
end
end
def environment_text_for_job
if subject.last?
"This job is the most recent deployment to %{environment_path}."
else
"This job is an out-of-date deployment to %{environment_path}. View the most recent deployment %{deployment_path}."
end
end
def deployment_path
return unless subject.environment.last_deployment
project_job_path(subject.project, subject.environment.last_deployment.deployable)
end
def self.matches?(deployment, user)
deployment.success?
end
end
end
end
end
end
|