-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for automatic publishing and distributing
Required PR: pulp/pulpcore#1084 closes: #7622 https://pulp.plan.io/issues/7622
- Loading branch information
Showing
12 changed files
with
380 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for automatic publishing and distributing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Generated by Django 2.2.18 on 2021-02-15 22:51 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
def populate_publish_settings(apps, schema_editor): | ||
RpmPublication = apps.get_model('rpm', 'rpmpublication') | ||
RpmPublishSettings = apps.get_model('rpm', 'rpmpublishsettings') | ||
|
||
for publication in RpmPublication.objects.all(): | ||
publish_settings, _ = RpmPublishSettings.objects.get_or_create( | ||
metadata_checksum_type=publication.metadata_checksum_type, | ||
package_checksum_type=publication.package_checksum_type, | ||
gpgcheck=publication.gpgcheck, | ||
repo_gpgcheck=publication.repo_gpgcheck, | ||
sqlite_metadata=publication.sqlite_metadata, | ||
) | ||
publication.publish_settings = publish_settings | ||
publication.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0059_publish_settings'), | ||
('rpm', '0030_DATA_fix_updaterecord'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='RpmPublishSettings', | ||
fields=[ | ||
('publishsettings_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='rpm_rpmpublishsettings', serialize=False, to='core.PublishSettings')), | ||
('metadata_checksum_type', models.CharField(choices=[('unknown', 'unknown'), ('md5', 'md5'), ('sha1', 'sha1'), ('sha1', 'sha1'), ('sha224', 'sha224'), ('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')], max_length=10)), | ||
('package_checksum_type', models.CharField(choices=[('unknown', 'unknown'), ('md5', 'md5'), ('sha1', 'sha1'), ('sha1', 'sha1'), ('sha224', 'sha224'), ('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')], max_length=10)), | ||
('gpgcheck', models.IntegerField(choices=[(0, 0), (1, 1)], default=0)), | ||
('repo_gpgcheck', models.IntegerField(choices=[(0, 0), (1, 1)], default=0)), | ||
('sqlite_metadata', models.BooleanField(default=False)), | ||
], | ||
options={ | ||
'default_related_name': '%(app_label)s_%(model_name)s', | ||
}, | ||
bases=('core.publishsettings',), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='rpmpublishsettings', | ||
unique_together={('metadata_checksum_type', 'package_checksum_type', 'gpgcheck', 'repo_gpgcheck', 'sqlite_metadata')}, | ||
), | ||
migrations.RunPython(populate_publish_settings), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 2.2.19 on 2021-02-23 18:05 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def migrate_distribution_fields(apps, schema_editor): | ||
# Set the core "_publication" field with the value of the detail "publication" field | ||
RpmDistribution = apps.get_model('rpm', 'rpmdistribution') | ||
|
||
distributions = list(RpmDistribution.objects.all()) | ||
|
||
for distribution in distributions: | ||
distribution._publication = distribution.publication | ||
|
||
RpmDistribution.objects.bulk_update(distributions, ['_publication']) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('rpm', '0031_auto_publish'), | ||
('core', '0060_add_new_distribution_fields'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='rpmdistribution', | ||
name='publication', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.