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:
authorRémy Coutable <remy@rymai.me>2016-12-19 11:42:52 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-12-21 16:21:56 +0300
commita3951f3fd9744599d5e7bf2111648c798637b3f8 (patch)
tree8a7a7fd2523f2439320fa143a37eb6ef878319b2 /lib/gitlab
parent8f0fe81a3d743299fae272e02b2917176c0e3c1d (diff)
Merge branch 'dockerfile-templates' into 'master'
Allow to use Dockerfile templates See merge request !7247
Diffstat (limited to 'lib/gitlab')
-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