From dfdbefe0ca5cf50c9b14494f868a187947ffdc05 Mon Sep 17 00:00:00 2001 From: Packet Please Date: Thu, 14 Nov 2024 05:02:42 +0100 Subject: [PATCH] buildbot: sign APK index file --- roles/buildbot/files/packages.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/roles/buildbot/files/packages.py b/roles/buildbot/files/packages.py index a26da0f..f7cfc61 100644 --- a/roles/buildbot/files/packages.py +++ b/roles/buildbot/files/packages.py @@ -110,6 +110,14 @@ def branchToFalterBranch(props): } return o2f.get(props["branch"]) +@util.renderer +def signCommand(props, wwwdir): + match props["branch"]: + case "openwrt-24.10" | "openwrt-23.05" | "openwrt-22.03" | "openwrt-21.02": + return f"signify-openbsd -S -m {wwwdir}/falter/Packages -s packagefeed_master.sec" + case _: + return f"apk adbsign --allow-untrusted --sign-key apk.snapshot.PRIVATE.pem {wwwdir}/falter/packages.adb" + # Fans out to one builder per arch and blocks for the results. def packagesFactory(f, wwwPrefix): @@ -292,10 +300,7 @@ def packagesArchFactory(f, wwwPrefix, wwwURL, alpineVersion): command=[ "sh", "-c", - util.Interpolate( - "signify-openbsd -S -m %(kw:wwwdir)s/falter/Packages -s packagefeed_master.sec", - wwwdir=wwwdir, - ), + signCommand.withArgs(wwwdir) ], ) ) @@ -304,11 +309,7 @@ def packagesArchFactory(f, wwwPrefix, wwwURL, alpineVersion): name="cleanup master", alwaysRun=True, warnOnFailure=False, - command=[ - "sh", - "-c", - util.Interpolate("rm -vf %(kw:tarfile)s", tarfile=tarfile), - ], + command=["sh", "-c", util.Interpolate("rm -vf %(kw:tarfile)s", tarfile=tarfile)], ) ) f.addStep(