taler-deployment

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

commit ff332f3e3bf194b3d4768e6c0bc4c0a69980c20b
parent e2c22e72af644b0c464ecbb38c830aa066b114f9
Author: Florian Dold <florian@dold.me>
Date:   Wed, 20 Aug 2025 14:37:30 +0200

packaging-ng: implement promotion directly in taler-pkg

Diffstat:
Dpackaging/ng/server-side/export-debian-bookworm.sh | 7-------
Dpackaging/ng/server-side/export-debian-trixie.sh | 7-------
Dpackaging/ng/server-side/export-ubuntu-noble.sh | 9---------
Dpackaging/ng/server-side/include-debian-bookworm.sh | 7-------
Dpackaging/ng/server-side/include-debian-trixie.sh | 7-------
Dpackaging/ng/server-side/include-ubuntu-noble.sh | 8--------
Dpackaging/ng/server-side/promote-debian-bookworm.sh | 8--------
Dpackaging/ng/server-side/promote-debian-trixie.sh | 8--------
Dpackaging/ng/server-side/promote-ubuntu-noble.sh | 9---------
Dpackaging/ng/server-side/show-debian-bookworm.sh | 7-------
Dpackaging/ng/server-side/show-ubuntu-noble.sh | 7-------
Mpackaging/ng/taler-pkg | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
12 files changed, 72 insertions(+), 90 deletions(-)

diff --git a/packaging/ng/server-side/export-debian-bookworm.sh b/packaging/ng/server-side/export-debian-bookworm.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro export bookworm diff --git a/packaging/ng/server-side/export-debian-trixie.sh b/packaging/ng/server-side/export-debian-trixie.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro export trixie diff --git a/packaging/ng/server-side/export-ubuntu-noble.sh b/packaging/ng/server-side/export-ubuntu-noble.sh @@ -1,9 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -export GPG_TTY=$(tty) - -cd www/apt/ubuntu -reprepro export noble diff --git a/packaging/ng/server-side/include-debian-bookworm.sh b/packaging/ng/server-side/include-debian-bookworm.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro includedeb bookworm-testing ~/debian-bookworm/*.deb diff --git a/packaging/ng/server-side/include-debian-trixie.sh b/packaging/ng/server-side/include-debian-trixie.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro includedeb trixie-testing ~/debian-trixie/*.deb diff --git a/packaging/ng/server-side/include-ubuntu-noble.sh b/packaging/ng/server-side/include-ubuntu-noble.sh @@ -1,8 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/ubuntu -reprepro includedeb noble ~/ubuntu-noble/*.deb -reprepro includeddeb noble ~/ubuntu-noble/*.ddeb diff --git a/packaging/ng/server-side/promote-debian-bookworm.sh b/packaging/ng/server-side/promote-debian-bookworm.sh @@ -1,8 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro pull bookworm - diff --git a/packaging/ng/server-side/promote-debian-trixie.sh b/packaging/ng/server-side/promote-debian-trixie.sh @@ -1,8 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro pull trixie - diff --git a/packaging/ng/server-side/promote-ubuntu-noble.sh b/packaging/ng/server-side/promote-ubuntu-noble.sh @@ -1,9 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/ubuntu -reprepro pull noble - - diff --git a/packaging/ng/server-side/show-debian-bookworm.sh b/packaging/ng/server-side/show-debian-bookworm.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/debian -reprepro list bookworm diff --git a/packaging/ng/server-side/show-ubuntu-noble.sh b/packaging/ng/server-side/show-ubuntu-noble.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -set -x -set -eu - -cd www/apt/ubuntu -reprepro list noble diff --git a/packaging/ng/taler-pkg b/packaging/ng/taler-pkg @@ -190,7 +190,7 @@ def show_order(cfg): def show_published(cfg): distro = cfg.distro - vendor, codename = distro.split("-") + vendor, codename = distro.split("-", 1) listfmt = "${package}_${version}_${architecture}.deb\n" subprocess.run( [ @@ -202,9 +202,49 @@ def show_published(cfg): ) +def promote(cfg): + dry = cfg.dry + distro = cfg.distro + vendor, codename = distro.split("-", 1) + listfmt = "${package}_${version}_${architecture}.deb\n" + if dry: + subprocess.run( + [ + "ssh", + f"taler-packaging@{host}", + f"reprepro -b /home/taler-packaging/www/apt/{vendor}/ checkpull {codename}", + ], + check=True, + ) + else: + subprocess.run( + [ + "ssh", + f"taler-packaging@{host}", + f"reprepro -b /home/taler-packaging/www/apt/{vendor}/ pull {codename}", + ], + check=True, + ) + # Always export! + # Reprepro is weird, listed packages might actually not show + # up in the index yet. + subprocess.run( + [ + "ssh", + "-t", + f"taler-packaging@{host}", + f"reprepro -b /home/taler-packaging/www/apt/{vendor}/ export {codename}-testing", + ], + check=True, + ) + + def publish(cfg): distro = cfg.distro - vendor, codename = distro.split("-") + if distro.endswith("-testing"): + print("Files are automatically published to testing", file=sys.stderr) + sys.exit(1) + vendor, codename = distro.split("-", 1) debs = [] listfmt = "${package}_${version}_${architecture}.deb\n" server_debs_str = subprocess.check_output( @@ -250,19 +290,38 @@ def publish(cfg): return debs = [Path(f"./packages/{distro}/") / x for x in debs] subprocess.run( - ["ssh", f"taler-packaging@{host}", f"rm -f '/home/taler-packaging/{distro}/'*.deb '/home/taler-packaging/{distro}/'*.ddeb" ], check=True + [ + "ssh", + f"taler-packaging@{host}", + f"rm -f '/home/taler-packaging/{distro}/'*.deb '/home/taler-packaging/{distro}/'*.ddeb", + ], + check=True, ) subprocess.run( ["scp", "--", *debs, f"taler-packaging@{host}:{distro}/"], check=True ) - subprocess.run( - ["ssh", "-t", f"taler-packaging@{host}", f"./include-{distro}.sh"], check=True + ret = subprocess.run( + [ + "ssh", + "-t", + f"taler-packaging@{host}", + f"reprepro -b /home/taler-packaging/www/apt/{vendor}/ includedeb {codename}-testing ~/debian-trixie/*.deb", + ], ) + if ret != 0: + # Usually not critical if it fails. + print("Including debs failed. This can happen when including packages that have been included previously") # Always export! # Reprepro is weird, listed packages might actually not show # up in the index yet. subprocess.run( - ["ssh", "-t", f"taler-packaging@{host}", f"./export-{distro}.sh"], check=True + [ + "ssh", + "-t", + f"taler-packaging@{host}", + f"reprepro -b /home/taler-packaging/www/apt/{vendor}/ export {codename}-testing", + ], + check=True, ) @@ -326,6 +385,13 @@ def main(): parser_publish.add_argument("distro") parser_publish.set_defaults(func=publish) + parser_promote = subparsers.add_parser("promote", help="Promote testing to stable") + parser_promote.add_argument( + "--dry", help="Dry run (show pulls)", action="store_true", default=False + ) + parser_promote.add_argument("distro") + parser_promote.set_defaults(func=promote) + args = parser.parse_args() if "func" not in args: