diff options
author | Devan Carpenter <devan@taler.net> | 2024-08-25 09:54:28 -0500 |
---|---|---|
committer | Devan Carpenter <devan@taler.net> | 2024-08-25 10:55:43 -0500 |
commit | 830afe1d13b1fb60d745fface72419ec93494811 (patch) | |
tree | 0a6b15ba64b8d82736c32664f01442f4d9585c1e | |
parent | 7e12f12fe9f50ebe948e5c02e823e7ae2366c5a5 (diff) |
Revert "unify debian packaging logic"
This reverts commit d5bb85938a28be816f3ec7ead1f01a4c88397650.
This commit broke several jobs. Will reapply changes selectively in
subsequent commit(s).
28 files changed, 450 insertions, 26 deletions
diff --git a/contrib/ci/jobs/000-codespell/job.sh b/contrib/ci/jobs/000-codespell/job.sh index 3270feb65..5b73aabf3 100755 --- a/contrib/ci/jobs/000-codespell/job.sh +++ b/contrib/ci/jobs/000-codespell/job.sh @@ -1,2 +1,107 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +skip=$(cat <<EOF +ABOUT-NLS +*/afl-tests/* +**/auditor/*.sql +**/templating/test-specs/* +*.bbl +*.bib +*build-aux* +*.bst +*.cache/* +*/cbdc-es.tex +*/cbdc-it.tex +*.cls +configure* +config.status +config.guess +./src/include/taler_dbevents.h +*/contrib/* +*/contrib/hellos/** +*.dat +*.deflate +*.doc +*/doc/* +**/doc/flows/main.de.tex +*/doc/texinfo.tex +*.docx +*.ecc +*.eot +*.epgz +*.eps +*.epub +**/ExchangeSelection/example.ts +*.fee +*.fees +*.file +**/fonts/** +*.gif +*/.git/** +*.gz +*/i18n/strings.ts +*.info +*.jpeg +*.jpg +*.??.json +*.json +*/keys/* +*key +*.latexmkrc +*libtool* +*.log +*/m4/* +*.m4 +**/*.map +*.min.js +*.mp4 +*.odg +*.ods +*.odt +*.pack.js +*.pdf +*.png +*.PNG +**/pnpm-lock.yaml +*.po +*.pptx +*.priv +**/rfc.bib +*.rpath +**/signing-key.asc +*.sqlite +*/src/anastasis-data.ts +**/*.svg +*.svg +*.tag +**/templating/mustach** +*/templating/test?/** +*/testcurl/test_tricky.c +*/debian/tmp/** +*/debian/taler-exchange/** +*/debian/.debhelper/** +*/debian/autoreconf.before +*/debian/autoreconf.after +debian/taler-terms-generator/**/* +taler-terms-generator +*.tgz +*.ttf +*.ttf +**/valgrind.h +*/vpn/tests/** +*.wav +*.woff +*.woff2 +*.xcf +*.xlsx +*.zkey +release-artifacts +EOF +); + +echo Current directory: `pwd` + +codespell -I "${job_dir}"/dictionary.txt -S ${skip//$'\n'/,} diff --git a/contrib/ci/jobs/002-test/job.sh b/contrib/ci/jobs/002-test/job.sh index 3270feb65..bfb24e335 100755 --- a/contrib/ci/jobs/002-test/job.sh +++ b/contrib/ci/jobs/002-test/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/test.sh diff --git a/contrib/ci/jobs/003-docs/job.sh b/contrib/ci/jobs/003-docs/job.sh index 3270feb65..a72bca4ba 100755 --- a/contrib/ci/jobs/003-docs/job.sh +++ b/contrib/ci/jobs/003-docs/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/docs.sh diff --git a/contrib/ci/jobs/100-build-debian-bookworm-amd64-gen/job.sh b/contrib/ci/jobs/100-build-debian-bookworm-amd64-gen/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/jobs/100-build-debian-bookworm-amd64-gen/job.sh +++ b/contrib/ci/jobs/100-build-debian-bookworm-amd64-gen/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh diff --git a/contrib/ci/debian-package-job.sh b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh index afeeff3ce..922f8bf63 100755 --- a/contrib/ci/debian-package-job.sh +++ b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/job.sh @@ -2,7 +2,7 @@ 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 @@ -12,7 +12,7 @@ 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)" +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 diff --git a/contrib/ci/version.sh b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/version.sh index e98e5862e..52031b23a 100755 --- a/contrib/ci/version.sh +++ b/contrib/ci/jobs/101-deb-package-debian-bookworm-amd64-gen/version.sh @@ -1,8 +1,5 @@ #!/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 diff --git a/contrib/ci/jobs/102-upload-debian-bookworm-amd64-gen/job.sh b/contrib/ci/jobs/102-upload-debian-bookworm-amd64-gen/job.sh index 3270feb65..bc77ef954 100755 --- a/contrib/ci/jobs/102-upload-debian-bookworm-amd64-gen/job.sh +++ b/contrib/ci/jobs/102-upload-debian-bookworm-amd64-gen/job.sh @@ -1,2 +1,18 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" +RELEASE_ARTIFACT_DIR="${RELEASE_ARTIFACT_DIR:-"$(dirname $0)/../../../../release-artifacts"}" + +if [[ -d "$RELEASE_ARTIFACT_DIR" ]]; then + rsync -vP $ARTIFACT_PATH $RELEASE_ARTIFACT_DIR +else + RSYNC_HOST=${RSYNC_HOST:-"taler.host.internal"} + RSYNC_PORT=${RSYNC_PORT:-424242} + RSYNC_PATH=${RSYNC_PATH:-"incoming_packages/bookworm-taler-ci/"} + RSYNC_DEST=${RSYNC_DEST:-"rsync://${RSYNC_HOST}/${RSYNC_PATH}"} + + rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} +fi; diff --git a/contrib/ci/jobs/105-build-debian-bookworm-arm64-gen/job.sh b/contrib/ci/jobs/105-build-debian-bookworm-arm64-gen/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/jobs/105-build-debian-bookworm-arm64-gen/job.sh +++ b/contrib/ci/jobs/105-build-debian-bookworm-arm64-gen/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh 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 3270feb65..922f8bf63 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,2 +1,23 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +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}/ 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 new file mode 100755 index 000000000..52031b23a --- /dev/null +++ b/contrib/ci/jobs/106-deb-package-debian-bookworm-arm64-gen/version.sh @@ -0,0 +1,17 @@ +#!/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/107-upload-debian-bookworm-arm64-gen/job.sh b/contrib/ci/jobs/107-upload-debian-bookworm-arm64-gen/job.sh index 3270feb65..bc77ef954 100755 --- a/contrib/ci/jobs/107-upload-debian-bookworm-arm64-gen/job.sh +++ b/contrib/ci/jobs/107-upload-debian-bookworm-arm64-gen/job.sh @@ -1,2 +1,18 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" +RELEASE_ARTIFACT_DIR="${RELEASE_ARTIFACT_DIR:-"$(dirname $0)/../../../../release-artifacts"}" + +if [[ -d "$RELEASE_ARTIFACT_DIR" ]]; then + rsync -vP $ARTIFACT_PATH $RELEASE_ARTIFACT_DIR +else + RSYNC_HOST=${RSYNC_HOST:-"taler.host.internal"} + RSYNC_PORT=${RSYNC_PORT:-424242} + RSYNC_PATH=${RSYNC_PATH:-"incoming_packages/bookworm-taler-ci/"} + RSYNC_DEST=${RSYNC_DEST:-"rsync://${RSYNC_HOST}/${RSYNC_PATH}"} + + rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} +fi; diff --git a/contrib/ci/jobs/110-build-debian-trixie-amd64-gen/job.sh b/contrib/ci/jobs/110-build-debian-trixie-amd64-gen/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/jobs/110-build-debian-trixie-amd64-gen/job.sh +++ b/contrib/ci/jobs/110-build-debian-trixie-amd64-gen/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh 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 3270feb65..922f8bf63 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,2 +1,23 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +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}/ diff --git a/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh new file mode 100755 index 000000000..52031b23a --- /dev/null +++ b/contrib/ci/jobs/111-deb-package-debian-trixie-amd64-gen/version.sh @@ -0,0 +1,17 @@ +#!/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/112-upload-debian-trixie-amd64-gen/job.sh b/contrib/ci/jobs/112-upload-debian-trixie-amd64-gen/job.sh index 3270feb65..4793d5bb1 100755 --- a/contrib/ci/jobs/112-upload-debian-trixie-amd64-gen/job.sh +++ b/contrib/ci/jobs/112-upload-debian-trixie-amd64-gen/job.sh @@ -1,2 +1,18 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" +RELEASE_ARTIFACT_DIR="${RELEASE_ARTIFACT_DIR:-"$(dirname $0)/../../../../release-artifacts"}" + +if [[ -d "$RELEASE_ARTIFACT_DIR" ]]; then + rsync -vP $ARTIFACT_PATH $RELEASE_ARTIFACT_DIR +else + RSYNC_HOST=${RSYNC_HOST:-"taler.host.internal"} + RSYNC_PORT=${RSYNC_PORT:-424242} + RSYNC_PATH=${RSYNC_PATH:-"incoming_packages/trixie-taler-ci/"} + RSYNC_DEST=${RSYNC_DEST:-"rsync://${RSYNC_HOST}/${RSYNC_PATH}"} + + rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} +fi; diff --git a/contrib/ci/jobs/115-build-debian-trixie-arm64-gen/job.sh b/contrib/ci/jobs/115-build-debian-trixie-arm64-gen/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/jobs/115-build-debian-trixie-arm64-gen/job.sh +++ b/contrib/ci/jobs/115-build-debian-trixie-arm64-gen/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh 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 3270feb65..922f8bf63 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,2 +1,23 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +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}/ 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 new file mode 100755 index 000000000..52031b23a --- /dev/null +++ b/contrib/ci/jobs/116-deb-package-debian-trixie-arm64-gen/version.sh @@ -0,0 +1,17 @@ +#!/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/117-upload-debian-trixie-arm64-gen/job.sh b/contrib/ci/jobs/117-upload-debian-trixie-arm64-gen/job.sh index 3270feb65..4793d5bb1 100755 --- a/contrib/ci/jobs/117-upload-debian-trixie-arm64-gen/job.sh +++ b/contrib/ci/jobs/117-upload-debian-trixie-arm64-gen/job.sh @@ -1,2 +1,18 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" +RELEASE_ARTIFACT_DIR="${RELEASE_ARTIFACT_DIR:-"$(dirname $0)/../../../../release-artifacts"}" + +if [[ -d "$RELEASE_ARTIFACT_DIR" ]]; then + rsync -vP $ARTIFACT_PATH $RELEASE_ARTIFACT_DIR +else + RSYNC_HOST=${RSYNC_HOST:-"taler.host.internal"} + RSYNC_PORT=${RSYNC_PORT:-424242} + RSYNC_PATH=${RSYNC_PATH:-"incoming_packages/trixie-taler-ci/"} + RSYNC_DEST=${RSYNC_DEST:-"rsync://${RSYNC_HOST}/${RSYNC_PATH}"} + + rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} +fi; diff --git a/contrib/ci/jobs/120-build-debian-unstable-amd64-gen/job.sh b/contrib/ci/jobs/120-build-debian-unstable-amd64-gen/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/jobs/120-build-debian-unstable-amd64-gen/job.sh +++ b/contrib/ci/jobs/120-build-debian-unstable-amd64-gen/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh 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 3270feb65..922f8bf63 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,2 +1,23 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +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}/ 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 new file mode 100755 index 000000000..52031b23a --- /dev/null +++ b/contrib/ci/jobs/121-deb-package-debian-unstable-amd64-gen/version.sh @@ -0,0 +1,17 @@ +#!/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/122-upload-debian-unstable-amd64-gen/job.sh b/contrib/ci/jobs/122-upload-debian-unstable-amd64-gen/job.sh index 3270feb65..ac6c27e56 100755 --- a/contrib/ci/jobs/122-upload-debian-unstable-amd64-gen/job.sh +++ b/contrib/ci/jobs/122-upload-debian-unstable-amd64-gen/job.sh @@ -1,2 +1,18 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" +RELEASE_ARTIFACT_DIR="${RELEASE_ARTIFACT_DIR:-"$(dirname $0)/../../../../release-artifacts"}" + +if [[ -d "$RELEASE_ARTIFACT_DIR" ]]; then + rsync -vP $ARTIFACT_PATH $RELEASE_ARTIFACT_DIR +else + RSYNC_HOST=${RSYNC_HOST:-"taler.host.internal"} + RSYNC_PORT=${RSYNC_PORT:-424242} + RSYNC_PATH=${RSYNC_PATH:-"incoming_packages/unstable-taler-ci/"} + RSYNC_DEST=${RSYNC_DEST:-"rsync://${RSYNC_HOST}/${RSYNC_PATH}"} + + rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} +fi; diff --git a/contrib/ci/jobs/125-build-debian-unstable-arm64-gen/job.sh b/contrib/ci/jobs/125-build-debian-unstable-arm64-gen/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/jobs/125-build-debian-unstable-arm64-gen/job.sh +++ b/contrib/ci/jobs/125-build-debian-unstable-arm64-gen/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh 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 3270feb65..922f8bf63 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,2 +1,23 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +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}/ 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 new file mode 100755 index 000000000..52031b23a --- /dev/null +++ b/contrib/ci/jobs/126-deb-package-debian-unstable-arm64-gen/version.sh @@ -0,0 +1,17 @@ +#!/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/127-upload-debian-unstable-arm64-gen/job.sh b/contrib/ci/jobs/127-upload-debian-unstable-arm64-gen/job.sh index 3270feb65..ac6c27e56 100755 --- a/contrib/ci/jobs/127-upload-debian-unstable-arm64-gen/job.sh +++ b/contrib/ci/jobs/127-upload-debian-unstable-arm64-gen/job.sh @@ -1,2 +1,18 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +ARTIFACT_PATH="/artifacts/exchange/${CI_COMMIT_REF}/*.deb" +RELEASE_ARTIFACT_DIR="${RELEASE_ARTIFACT_DIR:-"$(dirname $0)/../../../../release-artifacts"}" + +if [[ -d "$RELEASE_ARTIFACT_DIR" ]]; then + rsync -vP $ARTIFACT_PATH $RELEASE_ARTIFACT_DIR +else + RSYNC_HOST=${RSYNC_HOST:-"taler.host.internal"} + RSYNC_PORT=${RSYNC_PORT:-424242} + RSYNC_PATH=${RSYNC_PATH:-"incoming_packages/unstable-taler-ci/"} + RSYNC_DEST=${RSYNC_DEST:-"rsync://${RSYNC_HOST}/${RSYNC_PATH}"} + + rsync -vP \ + --port ${RSYNC_PORT} \ + ${ARTIFACT_PATH} ${RSYNC_DEST} +fi; diff --git a/contrib/ci/targets/debian/build/job.sh b/contrib/ci/targets/debian/build/job.sh index 3270feb65..8d79902c5 100755 --- a/contrib/ci/targets/debian/build/job.sh +++ b/contrib/ci/targets/debian/build/job.sh @@ -1,2 +1,6 @@ #!/bin/bash -exec ./contrib/ci/debian-package-job.sh +set -exuo pipefail + +job_dir=$(dirname "${BASH_SOURCE[0]}") + +"${job_dir}"/build.sh |