taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit d1d842ce32ea6bbafcc2e49dfba1f3b61c36b848
parent 46afd879de0a9a4d118860378ef490f91f0e1399
Author: Florian Dold <florian@dold.me>
Date:   Wed,  4 Jun 2025 23:38:34 +0200

packaging: only upload latest version of each deb

Diffstat:
Mpackaging/ng/buildscripts/generic.sh | 6++++++
Mpackaging/ng/taler-pkg | 30++++++++++++++++++++++++------
2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/packaging/ng/buildscripts/generic.sh b/packaging/ng/buildscripts/generic.sh @@ -57,4 +57,10 @@ dpkg-buildpackage -rfakeroot -b -uc -us cp ../*.deb /pkgdir/ +# Save current deb file names for this package. +echo >/pkgdir/$PACKAGE.built.current +for deb in ../*.deb; do + echo $(basename $deb) >>/pkgdir/$PACKAGE.built.current +done + echo $TAG >/pkgdir/$PACKAGE.built.tag diff --git a/packaging/ng/taler-pkg b/packaging/ng/taler-pkg @@ -106,9 +106,9 @@ def find_outdated(pkgdir, roots): def build(cfg): - transitive = True - if cfg.no_transitive: - transitive = False + transitive = False + if cfg.transitive: + transitive = True distro = cfg.distro print("building", distro) dockerfile = f"distros/Dockerfile.{distro}" @@ -176,12 +176,27 @@ def show_order(cfg): def publish(cfg): distro = cfg.distro vendor, codename = distro.split("-") - debs = list(Path(f"./packages/{distro}/").glob("*.deb")) host = "taler.net" + #debs = list(Path(f"./packages/{distro}/").glob("*.deb")) + debs = [] + for component in components: + current = None + cf = Path(f"./packages/{distro}/{component}.built.current") + if not cf.exists(): + print(f"component {component} has no current packages") + continue + with open(f"./packages/{distro}/{component}.built.current") as f: + current = f.read().split() + print(f"component {component} has current packages:") + print(current) + debs.extend(current) if len(debs) == 0: print("nothing to upload") return - subprocess.run(["ssh", f"taler-packaging@{host}", f"rm {distro}/*.deb"], check=True) + if cfg.dry: + return + debs = [Path(f"./packages/{distro}/") / x for x in debs] + subprocess.run(["ssh", f"taler-packaging@{host}", f"rm -f '{distro}/*.deb'"], check=True) subprocess.run(["scp", "--", *debs, f"taler-packaging@{host}:{distro}/"], check=True) # FIXME: This fails when packages of the same version are already present. # That's a problem since builds are not bit-reproducible. @@ -202,7 +217,9 @@ def main(): parser_build = subparsers.add_parser("build", help="Build packages for distro.") parser_build.set_defaults(func=build) parser_build.add_argument("distro") - parser_build.add_argument("--no-transitive", help="Do not build transitive deps of changed components", action="store_true", default=False) + # Keep for backwards compat + parser_build.add_argument("--no-transitive", help="Do not build transitive deps of changed components (default)", action="store_true", dest="transitive", default=None) + parser_build.add_argument("--transitive", help="Build transitive deps of changed components", action="store_false", dest="transitive", default=None) parser_build.add_argument("--dry", help="Dry run", action="store_true", default=False) # subcommand show-latest @@ -221,6 +238,7 @@ def main(): # subcommand publish parser_publish = subparsers.add_parser("publish", help="Publish to deb.taler.net") + parser_publish.add_argument("--dry", help="Dry run", action="store_true", default=False) parser_publish.add_argument("distro") parser_publish.set_defaults(func=publish)