summaryrefslogtreecommitdiff
path: root/lib/gitlab/template
diff options
context:
space:
mode:
authorAdam Niedzielski <adamsunday@gmail.com>2016-12-21 16:21:55 +0100
committerAdam Niedzielski <adamsunday@gmail.com>2016-12-21 16:21:55 +0100
commit9809a9af8a3980f8a65262295cfd9701e793ac11 (patch)
tree7f7f392a203798b2cbebba6c08f8875c433ca4f0 /lib/gitlab/template
parent528c3e2b8d2d65257e489601220f34b918b80e17 (diff)
downloadgitlab-ce-9809a9af8a3980f8a65262295cfd9701e793ac11.tar.gz
Introduce "Set up autodeploy" button to help configure GitLab CI for deploymentadam-auto-deploy
The button allows to choose a ".gitlab-ci.yml" template that automatically sets up the deployment of an application. The currently supported template is Kubernetes template.
Diffstat (limited to 'lib/gitlab/template')
-rw-r--r--lib/gitlab/template/gitlab_ci_yml_template.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab/template/gitlab_ci_yml_template.rb b/lib/gitlab/template/gitlab_ci_yml_template.rb
index 8d1a1ed54c9..d19b0a52043 100644
--- a/lib/gitlab/template/gitlab_ci_yml_template.rb
+++ b/lib/gitlab/template/gitlab_ci_yml_template.rb
@@ -13,8 +13,9 @@ module Gitlab
def categories
{
- "General" => '',
- "Pages" => 'Pages'
+ 'General' => '',
+ 'Pages' => 'Pages',
+ 'Autodeploy' => 'autodeploy'
}
end
@@ -25,6 +26,11 @@ module Gitlab
def finder(project = nil)
Gitlab::Template::Finders::GlobalTemplateFinder.new(self.base_dir, self.extension, self.categories)
end
+
+ def dropdown_names(context)
+ categories = context == 'autodeploy' ? ['Autodeploy'] : ['General', 'Pages']
+ super().slice(*categories)
+ end
end
end
end