summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-01-18 13:50:15 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2017-02-06 14:51:18 -0600
commit085d5eae8a13f6ac032321a601916eb6493045b8 (patch)
tree5e4b2e15aa6107eaaff0ebb4cf79f90c9fd729ef /app/controllers
parentd00e00ad66ae8cecd50899762503919289217453 (diff)
downloadgitlab-ce-085d5eae8a13f6ac032321a601916eb6493045b8.tar.gz
Added private methods to initialize variables in the ci_cd_pipelines_controller
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/settings/ci_cd_pipelines_controller.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/app/controllers/projects/settings/ci_cd_pipelines_controller.rb b/app/controllers/projects/settings/ci_cd_pipelines_controller.rb
index f570215af04..f9707d2df41 100644
--- a/app/controllers/projects/settings/ci_cd_pipelines_controller.rb
+++ b/app/controllers/projects/settings/ci_cd_pipelines_controller.rb
@@ -4,18 +4,29 @@ module Projects
before_action :authorize_admin_pipeline!
def show
- # runners
+ define_runners_variables
+ # variables
+ @variable = Ci::Variable.new
+ define_triggers_variables
+ define_badges_variables
+ end
+
+ private
+
+ def define_runners_variables
@project_runners = @project.runners.ordered
@assignable_runners = current_user.ci_authorized_runners.
assignable_for(project).ordered.page(params[:page]).per(20)
@shared_runners = Ci::Runner.shared.active
@shared_runners_count = @shared_runners.count(:all)
- # variables
- @variable = Ci::Variable.new
- # triggers
+ end
+
+ def define_triggers_variables
@triggers = @project.triggers
@trigger = Ci::Trigger.new
- # pipelines
+ end
+
+ def define_badges_variables
@ref = params[:ref] || @project.default_branch || 'master'
@badges = [Gitlab::Badge::Build::Status,