summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-08-15 12:44:51 +0000
committerDouwe Maan <douwe@gitlab.com>2017-08-15 12:44:51 +0000
commitf2cae26836570a1feadc488aa086215c53024e0d (patch)
tree7d0a6827634ab87586f51ccd886b8888c1085a2e /lib
parent4a2a6d521a260981482ee8e4931ebf06cb4f5b6a (diff)
parent639140677410f11955947980aa47356e1136c32e (diff)
downloadgitlab-ce-f2cae26836570a1feadc488aa086215c53024e0d.tar.gz
Merge branch 'zj-add-two-more-project-templates' into 'master'
Add two more project templates See merge request !13415
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/project_template.rb4
-rw-r--r--lib/tasks/gitlab/update_templates.rake9
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/gitlab/project_template.rb b/lib/gitlab/project_template.rb
index cf461adf697..732fbf68dad 100644
--- a/lib/gitlab/project_template.rb
+++ b/lib/gitlab/project_template.rb
@@ -25,7 +25,9 @@ module Gitlab
end
TEMPLATES_TABLE = [
- ProjectTemplate.new('rails', 'Ruby on Rails')
+ ProjectTemplate.new('rails', 'Ruby on Rails'),
+ ProjectTemplate.new('spring', 'Spring'),
+ ProjectTemplate.new('express', 'NodeJS Express')
].freeze
class << self
diff --git a/lib/tasks/gitlab/update_templates.rake b/lib/tasks/gitlab/update_templates.rake
index a7e30423c7a..f44abc2b81b 100644
--- a/lib/tasks/gitlab/update_templates.rake
+++ b/lib/tasks/gitlab/update_templates.rake
@@ -21,13 +21,18 @@ namespace :gitlab do
params = {
import_url: template.clone_url,
namespace_id: admin.namespace.id,
- path: template.title,
+ path: template.name,
skip_wiki: true
}
- puts "Creating project for #{template.name}"
+ puts "Creating project for #{template.title}"
project = Projects::CreateService.new(admin, params).execute
+ unless project.persisted?
+ puts project.errors.messages
+ exit(1)
+ end
+
loop do
if project.finished?
puts "Import finished for #{template.name}"