summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/status/build/retryable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/status/build/retryable.rb')
-rw-r--r--lib/gitlab/ci/status/build/retryable.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/gitlab/ci/status/build/retryable.rb b/lib/gitlab/ci/status/build/retryable.rb
new file mode 100644
index 00000000000..b3c0eedadf8
--- /dev/null
+++ b/lib/gitlab/ci/status/build/retryable.rb
@@ -0,0 +1,31 @@
+module Gitlab
+ module Ci
+ module Status
+ module Status
+ class Retryable < SimpleDelegator
+ extend Status::Extended
+
+ def has_action?(current_user)
+ can?(current_user, :update_build, subject)
+ end
+
+ def action_icon
+ 'repeat'
+ end
+
+ def action_path
+ retry_namespace_project_build_path(subject.project.namespace, subject.project, subject)
+ end
+
+ def action_method
+ :post
+ end
+
+ def self.matches?(build)
+ build.retryable?
+ end
+ end
+ end
+ end
+ end
+end