Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-02 18:41:32 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2016-11-08 16:54:58 +0300
commit6970c1f331e1f56424ff90fe43113d9f512bce95 (patch)
tree3e32aef0ea97787c2dbe53c26d6c8c1e6f204477 /lib/gitlab/template
parent35142a097865b1083ddea95c8507aab07e52a4ed (diff)
Allow to use Dockerfile templates
Diffstat (limited to 'lib/gitlab/template')
-rw-r--r--lib/gitlab/template/dockerfile_template.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/gitlab/template/dockerfile_template.rb b/lib/gitlab/template/dockerfile_template.rb
new file mode 100644
index 00000000000..d5d3e045a42
--- /dev/null
+++ b/lib/gitlab/template/dockerfile_template.rb
@@ -0,0 +1,30 @@
+module Gitlab
+ module Template
+ class DockerfileTemplate < BaseTemplate
+ def content
+ explanation = "# This file is a template, and might need editing before it works on your project."
+ [explanation, super].join("\n")
+ end
+
+ class << self
+ def extension
+ 'Dockerfile'
+ end
+
+ def categories
+ {
+ "General" => ''
+ }
+ end
+
+ def base_dir
+ Rails.root.join('vendor/dockerfile')
+ end
+
+ def finder(project = nil)
+ Gitlab::Template::Finders::GlobalTemplateFinder.new(self.base_dir, self.extension, self.categories)
+ end
+ end
+ end
+ end
+end