aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Carpenter <git@dvn.me>2023-11-27 22:36:51 -0500
committerDevan Carpenter <git@dvn.me>2023-11-27 22:47:10 -0500
commit9dd915b5a0b59dfa2589ffc7f8e4ce3b60bdeafb (patch)
treefda3bf7ee9c89d7166652914fd03690f36e8b36f
parentd11add3f588b18e20382646005721fc673ba2624 (diff)
downloadgnunet-dev/dvn/2023-buildbot-ci.tar.gz
gnunet-dev/dvn/2023-buildbot-ci.zip
ci: update version script to work on detached headdev/dvn/2023-buildbot-ci
git version 2.4.4 changed the way rev-parsing worked in a detached head state
-rwxr-xr-xcontrib/ci/jobs/2-deb-package/version.sh19
-rwxr-xr-xcontrib/ci/jobs/5-arm64-deb-package/version.sh19
2 files changed, 24 insertions, 14 deletions
diff --git a/contrib/ci/jobs/2-deb-package/version.sh b/contrib/ci/jobs/2-deb-package/version.sh
index 74d0099a2..c5b4e395a 100755
--- a/contrib/ci/jobs/2-deb-package/version.sh
+++ b/contrib/ci/jobs/2-deb-package/version.sh
@@ -1,12 +1,17 @@
1#!/bin/sh 1#!/bin/sh
2set -ex 2set -ex
3 3
4git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags 4BRANCH=$(git name-rev --name-only HEAD)
5RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD) 5if [ -z "${BRANCH}" ]; then
6 6 exit 1
7commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
8if [ "${commits}" = "0" ]; then
9 git describe --tag HEAD
10else 7else
11 echo $(echo ${RECENT_VERSION_TAG} | cut -d'v' -f2)-${commits}-$(git rev-parse --short=8 HEAD) 8 # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
9 git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
10 RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD)
11 commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
12 if [ "${commits}" = "0" ]; then
13 git describe --tag HEAD
14 else
15 echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
16 fi
12fi 17fi
diff --git a/contrib/ci/jobs/5-arm64-deb-package/version.sh b/contrib/ci/jobs/5-arm64-deb-package/version.sh
index 74d0099a2..c5b4e395a 100755
--- a/contrib/ci/jobs/5-arm64-deb-package/version.sh
+++ b/contrib/ci/jobs/5-arm64-deb-package/version.sh
@@ -1,12 +1,17 @@
1#!/bin/sh 1#!/bin/sh
2set -ex 2set -ex
3 3
4git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags 4BRANCH=$(git name-rev --name-only HEAD)
5RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD) 5if [ -z "${BRANCH}" ]; then
6 6 exit 1
7commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
8if [ "${commits}" = "0" ]; then
9 git describe --tag HEAD
10else 7else
11 echo $(echo ${RECENT_VERSION_TAG} | cut -d'v' -f2)-${commits}-$(git rev-parse --short=8 HEAD) 8 # "Unshallow" our checkout, but only our current branch, and exclude the submodules.
9 git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
10 RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD)
11 commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
12 if [ "${commits}" = "0" ]; then
13 git describe --tag HEAD
14 else
15 echo $(echo ${RECENT_VERSION_TAG} | sed -r 's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
16 fi
12fi 17fi