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.
This commit is contained in:
Z.J. van de Weg 2017-08-09 12:16:43 +02:00 committed by Zeger-Jan van de Weg
parent 4a2a6d521a
commit 6391406774
No known key found for this signature in database
GPG key ID: 65F6A8D64A88ABAC
7 changed files with 13 additions and 4 deletions

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -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

View file

@ -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}"

View file

@ -4,7 +4,9 @@ describe Gitlab::ProjectTemplate do
describe '.all' do
it 'returns a all templates' do
expected = [
described_class.new('rails', 'Ruby on Rails')
described_class.new('rails', 'Ruby on Rails'),
described_class.new('spring', 'Spring'),
described_class.new('express', 'NodeJS Express')
]
expect(described_class.all).to be_an(Array)

BIN
vendor/project_templates/express.tar.gz vendored Normal file

Binary file not shown.

BIN
vendor/project_templates/spring.tar.gz vendored Normal file

Binary file not shown.