aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Carpenter <devan@taler.net>2024-08-25 10:52:06 -0500
committerDevan Carpenter <devan@taler.net>2024-08-25 10:55:44 -0500
commit5f1567bd775aeb245bc4847ce5d76ccd1607de30 (patch)
tree7d252b648d750a6d771abd577456f54302f9948d
parent830afe1d13b1fb60d745fface72419ec93494811 (diff)
CI: unify debian packaging jobs
-rwxr-xr-xcontrib/ci/debian-package-job.sh23
-rwxr-xr-xcontrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/install-fix.patch13
-rwxr-xr-xcontrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh22
-rwxr-xr-xcontrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/version.sh17
-rwxr-xr-xcontrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/install-fix.patch13
-rwxr-xr-xcontrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/job.sh22
-rwxr-xr-xcontrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/version.sh17
-rwxr-xr-xcontrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/install-fix.patch13
-rwxr-xr-xcontrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/job.sh22
-rwxr-xr-xcontrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/install-fix.patch13
-rwxr-xr-xcontrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/job.sh22
-rwxr-xr-xcontrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/version.sh17
-rwxr-xr-xcontrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/install-fix.patch13
-rwxr-xr-xcontrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/job.sh22
-rwxr-xr-xcontrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/version.sh17
-rwxr-xr-xcontrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/install-fix.patch13
-rwxr-xr-xcontrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/job.sh22
-rwxr-xr-xcontrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/version.sh17
-rwxr-xr-xcontrib/ci/targets/debian/deb-package/job.sh22
-rwxr-xr-xcontrib/ci/targets/debian/setup-job.sh2
-rwxr-xr-xcontrib/ci/version.sh (renamed from contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh)3
21 files changed, 33 insertions, 312 deletions
diff --git a/contrib/ci/debian-package-job.sh b/contrib/ci/debian-package-job.sh
new file mode 100755
index 000000000..afeeff3ce
--- /dev/null
+++ b/contrib/ci/debian-package-job.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -exuo pipefail
+# This file is in the public domain.
+# Helper script to build the latest DEB packages in the container.
+# Shared between various jobs.
+
+unset LD_LIBRARY_PATH
+
+# Install build-time dependencies.
+# Update apt cache first
+apt-get update
+apt-get upgrade -y
+mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
+
+export VERSION="$(./contrib/ci/version.sh)"
+echo "Building package version ${VERSION}"
+EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
+./bootstrap
+dpkg-buildpackage -rfakeroot -b -uc -us
+
+ls -alh ../*.deb
+mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
+mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
diff --git a/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/install-fix.patch b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/install-fix.patch
deleted file mode 100755
index 8334c5a7a..000000000
--- a/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/install-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
-index 631c270b..072c6231 100644
---- a/debian/taler-exchange.install
-+++ b/debian/taler-exchange.install
-@@ -36,6 +36,6 @@ usr/share/taler/exchange/templates/*.must
- debian/etc-taler-exchange/* etc/
-
- # Terms of service / privacy policy templates
--usr/share/taler/exchange/*.rst
-+#usr/share/taler/exchange/terms/*.rst
- # Translations of ToS/PP
--usr/share/taler/exchange/locale/*/LC_MESSAGES/*.po
-+#usr/share/taler/exchange/terms/locale/*/LC_MESSAGES/*.po
diff --git a/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh
+++ b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/version.sh b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/version.sh
deleted file mode 100755
index 52031b23a..000000000
--- a/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/version.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-set -ex
-
-BRANCH=$(git name-rev --name-only HEAD)
-if [ -z "${BRANCH}" ]; then
- exit 1
-else
- # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
- git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
- RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --always --abbrev=0 HEAD || exit 1)
- commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
- if [ "${commits}" = "0" ]; then
- git describe --tag HEAD | sed -r 's/^v//' || exit 1
- else
- echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
- fi
-fi
diff --git a/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/install-fix.patch b/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/install-fix.patch
deleted file mode 100755
index 8334c5a7a..000000000
--- a/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/install-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
-index 631c270b..072c6231 100644
---- a/debian/taler-exchange.install
-+++ b/debian/taler-exchange.install
-@@ -36,6 +36,6 @@ usr/share/taler/exchange/templates/*.must
- debian/etc-taler-exchange/* etc/
-
- # Terms of service / privacy policy templates
--usr/share/taler/exchange/*.rst
-+#usr/share/taler/exchange/terms/*.rst
- # Translations of ToS/PP
--usr/share/taler/exchange/locale/*/LC_MESSAGES/*.po
-+#usr/share/taler/exchange/terms/locale/*/LC_MESSAGES/*.po
diff --git a/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/job.sh b/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/job.sh
+++ b/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/version.sh b/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/version.sh
deleted file mode 100755
index 52031b23a..000000000
--- a/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/version.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-set -ex
-
-BRANCH=$(git name-rev --name-only HEAD)
-if [ -z "${BRANCH}" ]; then
- exit 1
-else
- # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
- git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
- RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --always --abbrev=0 HEAD || exit 1)
- commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
- if [ "${commits}" = "0" ]; then
- git describe --tag HEAD | sed -r 's/^v//' || exit 1
- else
- echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
- fi
-fi
diff --git a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/install-fix.patch b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/install-fix.patch
deleted file mode 100755
index 8334c5a7a..000000000
--- a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/install-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
-index 631c270b..072c6231 100644
---- a/debian/taler-exchange.install
-+++ b/debian/taler-exchange.install
-@@ -36,6 +36,6 @@ usr/share/taler/exchange/templates/*.must
- debian/etc-taler-exchange/* etc/
-
- # Terms of service / privacy policy templates
--usr/share/taler/exchange/*.rst
-+#usr/share/taler/exchange/terms/*.rst
- # Translations of ToS/PP
--usr/share/taler/exchange/locale/*/LC_MESSAGES/*.po
-+#usr/share/taler/exchange/terms/locale/*/LC_MESSAGES/*.po
diff --git a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/job.sh b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/job.sh
+++ b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/install-fix.patch b/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/install-fix.patch
deleted file mode 100755
index 8334c5a7a..000000000
--- a/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/install-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
-index 631c270b..072c6231 100644
---- a/debian/taler-exchange.install
-+++ b/debian/taler-exchange.install
-@@ -36,6 +36,6 @@ usr/share/taler/exchange/templates/*.must
- debian/etc-taler-exchange/* etc/
-
- # Terms of service / privacy policy templates
--usr/share/taler/exchange/*.rst
-+#usr/share/taler/exchange/terms/*.rst
- # Translations of ToS/PP
--usr/share/taler/exchange/locale/*/LC_MESSAGES/*.po
-+#usr/share/taler/exchange/terms/locale/*/LC_MESSAGES/*.po
diff --git a/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/job.sh b/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/job.sh
+++ b/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/version.sh b/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/version.sh
deleted file mode 100755
index 52031b23a..000000000
--- a/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/version.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-set -ex
-
-BRANCH=$(git name-rev --name-only HEAD)
-if [ -z "${BRANCH}" ]; then
- exit 1
-else
- # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
- git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
- RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --always --abbrev=0 HEAD || exit 1)
- commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
- if [ "${commits}" = "0" ]; then
- git describe --tag HEAD | sed -r 's/^v//' || exit 1
- else
- echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
- fi
-fi
diff --git a/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/install-fix.patch b/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/install-fix.patch
deleted file mode 100755
index 8334c5a7a..000000000
--- a/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/install-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
-index 631c270b..072c6231 100644
---- a/debian/taler-exchange.install
-+++ b/debian/taler-exchange.install
-@@ -36,6 +36,6 @@ usr/share/taler/exchange/templates/*.must
- debian/etc-taler-exchange/* etc/
-
- # Terms of service / privacy policy templates
--usr/share/taler/exchange/*.rst
-+#usr/share/taler/exchange/terms/*.rst
- # Translations of ToS/PP
--usr/share/taler/exchange/locale/*/LC_MESSAGES/*.po
-+#usr/share/taler/exchange/terms/locale/*/LC_MESSAGES/*.po
diff --git a/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/job.sh b/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/job.sh
+++ b/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/version.sh b/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/version.sh
deleted file mode 100755
index 52031b23a..000000000
--- a/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/version.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-set -ex
-
-BRANCH=$(git name-rev --name-only HEAD)
-if [ -z "${BRANCH}" ]; then
- exit 1
-else
- # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
- git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
- RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --always --abbrev=0 HEAD || exit 1)
- commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
- if [ "${commits}" = "0" ]; then
- git describe --tag HEAD | sed -r 's/^v//' || exit 1
- else
- echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
- fi
-fi
diff --git a/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/install-fix.patch b/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/install-fix.patch
deleted file mode 100755
index 8334c5a7a..000000000
--- a/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/install-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
-index 631c270b..072c6231 100644
---- a/debian/taler-exchange.install
-+++ b/debian/taler-exchange.install
-@@ -36,6 +36,6 @@ usr/share/taler/exchange/templates/*.must
- debian/etc-taler-exchange/* etc/
-
- # Terms of service / privacy policy templates
--usr/share/taler/exchange/*.rst
-+#usr/share/taler/exchange/terms/*.rst
- # Translations of ToS/PP
--usr/share/taler/exchange/locale/*/LC_MESSAGES/*.po
-+#usr/share/taler/exchange/terms/locale/*/LC_MESSAGES/*.po
diff --git a/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/job.sh b/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/job.sh
+++ b/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/version.sh b/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/version.sh
deleted file mode 100755
index 52031b23a..000000000
--- a/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/version.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-set -ex
-
-BRANCH=$(git name-rev --name-only HEAD)
-if [ -z "${BRANCH}" ]; then
- exit 1
-else
- # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
- git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
- RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --always --abbrev=0 HEAD || exit 1)
- commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
- if [ "${commits}" = "0" ]; then
- git describe --tag HEAD | sed -r 's/^v//' || exit 1
- else
- echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
- fi
-fi
diff --git a/contrib/ci/targets/debian/deb-package/job.sh b/contrib/ci/targets/debian/deb-package/job.sh
index 922f8bf63..bc767b946 100755
--- a/contrib/ci/targets/debian/deb-package/job.sh
+++ b/contrib/ci/targets/debian/deb-package/job.sh
@@ -1,23 +1,3 @@
#!/bin/bash
-set -exuo pipefail
-# This file is in the public domain.
-# Helper script to build the latest DEB packages in the container.
-
-unset LD_LIBRARY_PATH
-
-# Install build-time dependencies.
-# Update apt cache first
-apt-get update
-apt-get upgrade -y
-mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
-
-export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
-echo "Building package version ${VERSION}"
-EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}"
-./bootstrap
-dpkg-buildpackage -rfakeroot -b -uc -us
-
-ls -alh ../*.deb
-mkdir -p /artifacts/exchange/${CI_COMMIT_REF} # Variable comes from CI environment
-mv ../*.deb /artifacts/exchange/${CI_COMMIT_REF}/
+exec ./contrib/ci/debian-package-job.sh
diff --git a/contrib/ci/targets/debian/setup-job.sh b/contrib/ci/targets/debian/setup-job.sh
index ad61c3ef1..e43a99e39 100755
--- a/contrib/ci/targets/debian/setup-job.sh
+++ b/contrib/ci/targets/debian/setup-job.sh
@@ -30,9 +30,7 @@ fi;
# Generate the deb-package target
cd "${CI_DIR}/jobs/$(mktarget 1 deb-package)"
sed "1s|FROM .*|FROM ${OCI_IMAGE}|" "$CONTAINERFILE" > Containerfile
-cp "$DISTRO_TARGET/deb-package/version.sh" ./
cp "$DISTRO_TARGET/deb-package/job.sh" ./
-cp "$DISTRO_TARGET/deb-package/install-fix.patch" ./
if [[ "$ARCH" != "amd64" ]]; then
echo '[build]
diff --git a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh b/contrib/ci/version.sh
index 52031b23a..e98e5862e 100755
--- a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh
+++ b/contrib/ci/version.sh
@@ -1,5 +1,8 @@
#!/bin/sh
set -ex
+# This file is in the public domain.
+# Determines the current version of our code.
+# Shared between various jobs.
BRANCH=$(git name-rev --name-only HEAD)
if [ -z "${BRANCH}" ]; then