diff options
Diffstat (limited to 'lib/gitlab/ci/status/deployment/success.rb')
-rw-r--r-- | lib/gitlab/ci/status/deployment/success.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/gitlab/ci/status/deployment/success.rb b/lib/gitlab/ci/status/deployment/success.rb new file mode 100644 index 00000000000..2f9229147cb --- /dev/null +++ b/lib/gitlab/ci/status/deployment/success.rb @@ -0,0 +1,25 @@ +module Gitlab + module Ci + module Status + module Deployment + class Success < Status::Extended + def environment_text + if subject.last? + "This job is the most recent deployment to %{environmentLink}." + else + "This job is an out-of-date deployment to %{environmentLink}. View the most recent deployment %{deploymentLink}." + end + end + + def deploymentLink + project_deployment_path(subject.project, subject.environment.last_successful_deployment) + end + + def self.matches?(deployment, user) + deployment.success? + end + end + end + end + end +end |