Commit 11f8eb2b authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

project suffix

parent c1cd22b9
Pipeline #2159 passed with stages
in 1 minute and 2 seconds
......@@ -21,9 +21,10 @@ class Command(BaseCommand):
for project in Project.objects.all():
for slug in [project.slug, project.slug.replace('_', '-')]:
for pkg in itertools.chain(path.glob(f'*/{slug}'), path.glob(f'*/py-{slug}')):
obj, created = Robotpkg.objects.get_or_create(name=pkg.name, category=pkg.parent.name,
project=project)
for pkg in itertools.chain(
path.glob(f'*/{slug}{project.suffix}'), path.glob(f'*/py-{slug}{project.suffix}')):
obj, created = Robotpkg.objects.get_or_create(
name=pkg.name, category=pkg.parent.name, project=project)
if created:
logger.info(f'{project} found in {pkg}')
obj.update(pull=False)
# Generated by Django 2.1.4 on 2019-01-16 18:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rainboard', '0026_archived'),
]
operations = [
migrations.AddField(
model_name='project',
name='suffix',
field=models.CharField(default='', max_length=50),
),
]
......@@ -12,9 +12,9 @@ from django.template.loader import get_template
from django.utils.dateparse import parse_datetime
from django.utils.safestring import mark_safe
import git
import requests
import git
from autoslug import AutoSlugField
from ndh.models import Links, NamedModel, TimeStampedModel
from ndh.utils import enum_to_choices, query_sum
......@@ -36,7 +36,13 @@ RPKG_LICENSES = {
'modified-bsd': 'BSD-3-Clause'
}
RPKG_FIELDS = ['PKGBASE', 'PKGVERSION', 'MASTER_SITES', 'MASTER_REPOSITORY', 'MAINTAINER', 'COMMENT', 'HOMEPAGE']
CMAKE_FIELDS = {'NAME': 'cmake_name', 'DESCRIPTION': 'description', 'URL': 'homepage', 'VERSION': 'version'}
CMAKE_FIELDS = {
'NAME': 'cmake_name',
'DESCRIPTION': 'description',
'URL': 'homepage',
'VERSION': 'version',
'SUFFIX': 'suffix'
}
TRAVIS_STATE = {'created': None, 'passed': True, 'started': None, 'failed': False, 'errored': False, 'canceled': False}
GITLAB_STATUS = {'failed': False, 'success': True, 'pending': None, 'skipped': None, 'canceled': None, 'running': None}
......@@ -185,6 +191,7 @@ class Project(Links, NamedModel, TimeStampedModel):
from_gepetto = models.BooleanField(default=True)
cmake_name = models.CharField(max_length=200, blank=True, null=True)
archived = models.BooleanField(default=False)
suffix = models.CharField(max_length=50, default='')
def save(self, *args, **kwargs):
self.name = valid_name(self.name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment