Allow management of components

This commit allows to add, remove and update components of published repositories without the need to recreate them.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
This commit is contained in:
Christoph Fiehe
2024-10-09 07:38:23 +02:00
committed by André Roth
parent 767bc6bd0b
commit bd64232eb6
45 changed files with 1248 additions and 179 deletions
-18
View File
@@ -1,18 +0,0 @@
#!/bin/sh -e
usermod -u `stat -c %u /work/src` aptly >/dev/null
chown -R `stat -c %u /work/src` /var/lib/aptly
su aptly -c 'set -e; cd /work/src;
GOPATH=$PWD/.go go generate -v
# install and initialize swagger
GOPATH=$PWD/.go go install github.com/swaggo/swag/cmd/swag@latest
PATH=$PWD/.go/bin:$PATH swag init -q --markdownFiles docs
git checkout debian/changelog
DEBEMAIL="CI <runner@github>" dch -v `make version` "CI build"
dpkg-buildpackage -us -uc -b -d
mkdir -p build && mv ../*.deb build/
rm -rf obj-*-linux-gnu*
git checkout debian/changelog
cd build && ls -l *.deb
'
+28 -30
View File
@@ -319,40 +319,36 @@ class BaseTest(object):
return subprocess.Popen(command, stderr=stderr, stdout=stdout, env=environ)
def run_cmd(self, command, expected_code=0):
try:
proc = self._start_process(command, stdout=subprocess.PIPE)
raw_output, _ = proc.communicate()
proc = self._start_process(command, stdout=subprocess.PIPE)
raw_output, _ = proc.communicate()
raw_output = raw_output.decode("utf-8", errors='replace')
raw_output = raw_output.decode("utf-8", errors='replace')
returncodes = [proc.returncode]
is_aptly_command = False
if isinstance(command, str):
is_aptly_command = command.startswith("aptly")
returncodes = [proc.returncode]
is_aptly_command = False
if isinstance(command, str):
is_aptly_command = command.startswith("aptly")
if isinstance(command, list):
is_aptly_command = command[0] == "aptly"
if isinstance(command, list):
is_aptly_command = command[0] == "aptly"
if is_aptly_command:
# remove the last two rows as go tests always print PASS/FAIL and coverage in those
# two lines. This would otherwise fail the tests as they would not match gold
matches = re.findall(r"((.|\n)*)EXIT: (\d)\n.*\ncoverage: .*", raw_output)
if not matches:
raise Exception("no matches found in output '%s'" % raw_output)
if is_aptly_command:
# remove the last two rows as go tests always print PASS/FAIL and coverage in those
# two lines. This would otherwise fail the tests as they would not match gold
matches = re.findall(r"((.|\n)*)EXIT: (\d)\n.*\ncoverage: .*", raw_output)
if not matches:
raise Exception("no matches found in command output '%s'" % raw_output)
output, _, returncode = matches[0]
returncodes.append(int(returncode))
else:
output = raw_output
output, _, returncode = matches[0]
returncodes.append(int(returncode))
else:
output = raw_output
if expected_code is not None:
if expected_code not in returncodes:
raise Exception("exit code %d != %d (output: %s)" % (
proc.returncode, expected_code, raw_output))
return output
except Exception as e:
raise Exception("Running command '%s' failed: %s" %
(command, str(e)))
if expected_code is not None:
if expected_code not in returncodes:
raise Exception("command expected to return %d, but returned %d: \n%s" % (
expected_code, proc.returncode, raw_output))
return output
def gold_processor(self, gold):
return gold
@@ -379,6 +375,8 @@ class BaseTest(object):
return s
def check_output(self):
gold_file = self.get_gold_filename()
print(f"Verifying gold file: {gold_file}")
try:
self.verify_match(self.get_gold(), self.output,
match_prepare=self.outputMatchPrepare)
@@ -464,11 +462,11 @@ class BaseTest(object):
def check_in(self, item, l):
if item not in l:
raise Exception("item %r not in %r", item, l)
raise Exception("expected item: %r\nnot found in: %r" % (item, l))
def check_not_in(self, item, l):
if item in l:
raise Exception("item %r in %r", item, l)
raise Exception("unexpected item: %r\n found in: %r" % (item, l))
def check_subset(self, a, b):
diff = ''
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo azure:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository azure:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot azure:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository azure:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -7,4 +7,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick [i386, source] publishes {main: [snap2]: Snapshot from local repo [local-repo2]} has been successfully switched to new snapshot.
Published snapshot repository ./maverick [i386, source] publishes {main: [snap2]: Snapshot from local repo [local-repo2]} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -4,4 +4,4 @@ Finalizing metadata files...
Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./bookworm (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository ./bookworm (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "ppa" components main...
Publish for snapshot ppa/maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully switched to new snapshot.
Published snapshot repository ppa/maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "ppa" components main...
Publish for snapshot ppa/maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully switched to new snapshot.
Published snapshot repository ppa/maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully switched to new source.
+1 -1
View File
@@ -1 +1 @@
ERROR: unable to update: published repo with storage:prefix/distribution ppa/maverick not found
ERROR: unable to switch: published repo with storage:prefix/distribution ppa/maverick not found
+1 -1
View File
@@ -1 +1 @@
ERROR: unable to update: not a snapshot publish
ERROR: unable to switch: local repo with name snap1 not found
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components b, c...
Publish for snapshot ./maverick [amd64, i386, source] publishes {a: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {b: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'}, {c: [local2]: Snapshot from local repo [local-repo]} has been successfully switched to new snapshot.
Published snapshot repository ./maverick [amd64, i386, source] publishes {a: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {b: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'}, {c: [local2]: Snapshot from local repo [local-repo]} has been successfully switched to new source.
+1 -1
View File
@@ -7,4 +7,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -4,4 +4,4 @@ Finalizing metadata files...
Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./bookworm [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./bookworm [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo ./maverick [source] publishes {main: [local-repo]} has been successfully updated.
Published local repository ./maverick [source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components contrib, main...
Publish for local repo ./maverick [i386, source] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated.
Published local repository ./maverick [i386, source] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated.
+1 -1
View File
@@ -3,4 +3,4 @@ Generating metadata files and linking package files...
Finalizing metadata files...
Cleaning up prefix "." components contrib, main...
Publish for local repo ./squeeze [i386] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated.
Published local repository ./squeeze [i386] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot s3:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Published snapshot repository s3:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source.
+1 -1
View File
@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for local repo s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.
Published local repository s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated.