Commit 03cb751c authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Target.public

parent c8bbfcd4
Pipeline #14882 failed with stage
in 1 minute and 25 seconds
# Generated by Django 3.2.4 on 2021-06-08 16:47
from django.db import migrations, models
def pal_private(apps, schema_editor):
Target = apps.get_model('rainboard', 'Target')
Target.objects.filter(name__in=['dubnium', 'erbium', 'ferrum']).update(public=False)
class Migration(migrations.Migration):
dependencies = [
('rainboard', '0056_disable_1604'),
]
operations = [
migrations.AddField(
model_name='target',
name='public',
field=models.BooleanField(default=True),
),
migrations.RunPython(pal_private),
]
...@@ -814,6 +814,7 @@ class Target(NamedModel): ...@@ -814,6 +814,7 @@ class Target(NamedModel):
active = models.BooleanField(default=True) active = models.BooleanField(default=True)
main = models.BooleanField(default=False) main = models.BooleanField(default=False)
py2_available = models.BooleanField(default=True) py2_available = models.BooleanField(default=True)
public = models.BooleanField(default=True)
objects = TargetQuerySet.as_manager() objects = TargetQuerySet.as_manager()
...@@ -956,12 +957,16 @@ class Image(models.Model): ...@@ -956,12 +957,16 @@ class Image(models.Model):
py = '' py = ''
return f'{self.robotpkg}{py}:{self.target}' return f'{self.robotpkg}{py}:{self.target}'
@property
def public(self):
return self.target.public and self.robotpkg.project.public
def get_build_args(self): def get_build_args(self):
ret = { ret = {
'TARGET': self.target, 'TARGET': self.target,
'ROBOTPKG': self.robotpkg, 'ROBOTPKG': self.robotpkg,
'CATEGORY': self.robotpkg.category, 'CATEGORY': self.robotpkg.category,
'REGISTRY': self.robotpkg.project.registry(), 'REGISTRY': settings.PUBLIC_REGISTRY if self.public else settings.PRIVATE_REGISTRY
'CCACHE': self.robotpkg.project.ccache, 'CCACHE': self.robotpkg.project.ccache,
} }
if not self.robotpkg.project.public: if not self.robotpkg.project.public:
......
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