Skip to content
Snippets Groups Projects
Commit 7f373e09 authored by Ariel D'Alessandro's avatar Ariel D'Alessandro
Browse files

aptly: Don't re-publish repositories on project updates


Aptly is currently re-publishing (dropping and publishing again)
repositories when the project configuration is changed. This is
performed to update the components and architectures of the published
distribution based on the updated project configuration.

OBS/aptly contains a hack allowing the usage of slashes `/` in the
publish distribution field, which we're currently using to have the
snapshots published in the same prefix and using a distribution name
with the form: `$release/snapshots/$timestamp`. This makes the snapshots
folder to be inside the same `dists` directory where the repositories
are published.

There's a bug in the above implementation, where:
* OBS project configuration is updated, triggering a re-publishing of
  the distribution.
* Aptly drops the published distribution.
* If aptly doesn't have any other distribution published in the same
  prefix, it will remove the entire `dists` folder, with all the
  snapshots in it.
* Aptly publishes the distribution again.

This bug is making aptly to drop all the snapshots, as it assumes these
can't be stored within the published distribution.

Let's HACK this quickly by disabling the re-publishing temporarily. Note
that OBS will create the aptly repositories and publish them on the
first project configuration, but it won't re-publish it at all on
further config updates.

Signed-off-by: Ariel D'Alessandro's avatarAriel D'Alessandro <ariel.dalessandro@collabora.com>
parent 76a63bb2
Branches
No related tags found
2 merge requests!39staging -> production: aptly: Don't re-publish repositories on project updates,!38aptly: Don't re-publish repositories on project updates
Pipeline #41689 passed
......@@ -416,7 +416,7 @@ sub aptly_putproject {
foreach my $repoid (keys %{ $oldrepos }) {
my $repo_config = $proj_config->{$repoid};
if (!$newrepos->{$repoid}) {
aptly_publish_drop_check($repo_config->{'prefix'}, $repo_config->{'distribution'});
#aptly_publish_drop_check($repo_config->{'prefix'}, $repo_config->{'distribution'});
aptly_repo_drop($proj->{'name'}, $repoid);
aptly_publish_repo($repo_config->{'prefix'}, $repo_config->{'distribution'});
}
......@@ -424,7 +424,7 @@ sub aptly_putproject {
foreach my $repoid (keys %{ $newrepos }) {
my $repo_config = $proj_config->{$repoid};
aptly_publish_drop_check($repo_config->{'prefix'}, $repo_config->{'distribution'});
#aptly_publish_drop_check($repo_config->{'prefix'}, $repo_config->{'distribution'});
if (!$oldrepos->{$repoid}) {
my $component = aptly_repo_get_component($proj->{'name'}, $repoid);
aptly_repo_create($proj->{'name'}, $repoid, $repo_config->{'distribution'}, $component);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment