merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 88a599d031dbc559b6a9f5f5c1a5803aa18b86ba
parent ad2db925d84ba2981691c49c5137b880ed5ffd6f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 19 Aug 2024 11:00:03 +0200

unify CI jobs

Diffstat:
Acontrib/ci/debian-package-job.sh | 23+++++++++++++++++++++++
Mcontrib/ci/jobs/4-deb-package/job.sh | 23+----------------------
Dcontrib/ci/jobs/4-deb-package/version.sh | 17-----------------
Tcontrib/ci/jobs/7-arm64-deb-package/job.sh | 0
Dcontrib/ci/jobs/7-arm64-deb-package/version.sh | 2--
Acontrib/ci/version.sh | 20++++++++++++++++++++
6 files changed, 44 insertions(+), 41 deletions(-)

diff --git a/contrib/ci/debian-package-job.sh 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/merchant/${CI_COMMIT_REF} # Variable comes from CI environment +mv ../*.deb /artifacts/merchant/${CI_COMMIT_REF}/ diff --git a/contrib/ci/jobs/4-deb-package/job.sh b/contrib/ci/jobs/4-deb-package/job.sh @@ -1,23 +1,2 @@ #!/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 --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}" -./bootstrap -dpkg-buildpackage -rfakeroot -b -uc -us - -ls -alh ../*.deb -mkdir -p /artifacts/merchant/${CI_COMMIT_REF} # Variable comes from CI environment -mv ../*.deb /artifacts/merchant/${CI_COMMIT_REF}/ +exec ./contrib/ci/debian-package-job.sh diff --git a/contrib/ci/jobs/4-deb-package/version.sh b/contrib/ci/jobs/4-deb-package/version.sh @@ -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/7-arm64-deb-package/job.sh b/contrib/ci/jobs/7-arm64-deb-package/job.sh diff --git a/contrib/ci/jobs/7-arm64-deb-package/version.sh b/contrib/ci/jobs/7-arm64-deb-package/version.sh @@ -1 +0,0 @@ -../4-deb-package/version.sh -\ No newline at end of file diff --git a/contrib/ci/version.sh b/contrib/ci/version.sh @@ -0,0 +1,20 @@ +#!/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 + 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