summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-05-02 18:27:35 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-05-02 18:27:35 +0000
commitacaef5e35b9519b5e4ebcefee274e8c8f3d8c85a (patch)
tree350ea2de8e0bdaf171f09c5b5886da026f3fc2e1 /lib
parent0c3d7830c5fdaef029457557f7b4ad867805b06a (diff)
parent5432f5480f334a0bd15ed06568e0c82f0dd54e45 (diff)
downloadgitlab-ce-acaef5e35b9519b5e4ebcefee274e8c8f3d8c85a.tar.gz
Merge branch '28741-play-all-manual-jobs' into 'master'
Play all manual jobs in a stage Closes #28741 See merge request gitlab-org/gitlab-ce!27188
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/status/stage/factory.rb3
-rw-r--r--lib/gitlab/ci/status/stage/play_manual.rb43
2 files changed, 45 insertions, 1 deletions
diff --git a/lib/gitlab/ci/status/stage/factory.rb b/lib/gitlab/ci/status/stage/factory.rb
index 58f4642510b..e50b0853725 100644
--- a/lib/gitlab/ci/status/stage/factory.rb
+++ b/lib/gitlab/ci/status/stage/factory.rb
@@ -6,7 +6,8 @@ module Gitlab
module Stage
class Factory < Status::Factory
def self.extended_statuses
- [Status::SuccessWarning]
+ [[Status::SuccessWarning],
+ [Status::Stage::PlayManual]]
end
def self.common_helpers
diff --git a/lib/gitlab/ci/status/stage/play_manual.rb b/lib/gitlab/ci/status/stage/play_manual.rb
new file mode 100644
index 00000000000..ac3fc0912fa
--- /dev/null
+++ b/lib/gitlab/ci/status/stage/play_manual.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Ci
+ module Status
+ module Stage
+ class PlayManual < Status::Extended
+ include Gitlab::Routing
+
+ def action_icon
+ 'play'
+ end
+
+ def action_title
+ 'Play all manual'
+ end
+
+ def action_path
+ pipeline = subject.pipeline
+
+ project_stage_play_manual_path(pipeline.project, pipeline, subject.name)
+ end
+
+ def action_method
+ :post
+ end
+
+ def action_button_title
+ _('Play all manual')
+ end
+
+ def self.matches?(stage, user)
+ stage.manual_playable?
+ end
+
+ def has_action?
+ true
+ end
+ end
+ end
+ end
+ end
+end