diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-08-09 12:16:43 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2017-08-15 12:55:54 +0200 |
commit | 639140677410f11955947980aa47356e1136c32e (patch) | |
tree | 7d0a6827634ab87586f51ccd886b8888c1085a2e /lib | |
parent | 4a2a6d521a260981482ee8e4931ebf06cb4f5b6a (diff) | |
download | gitlab-ce-639140677410f11955947980aa47356e1136c32e.tar.gz |
Add two more project templateszj-add-two-more-project-templates
Related to !13108. Mostly this is just running the rake task and
changing the task a bit to catch cases like the project already existing
or so. The rake task moves archives to the vendor/project_template
directory, which are checked in too.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/project_template.rb | 4 | ||||
-rw-r--r-- | lib/tasks/gitlab/update_templates.rake | 9 |
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}" |