diff options
author | Devan Carpenter <git@dvn.me> | 2023-11-27 22:36:51 -0500 |
---|---|---|
committer | Devan Carpenter <git@dvn.me> | 2023-11-27 22:47:10 -0500 |
commit | 9dd915b5a0b59dfa2589ffc7f8e4ce3b60bdeafb (patch) | |
tree | fda3bf7ee9c89d7166652914fd03690f36e8b36f /contrib/ci | |
parent | d11add3f588b18e20382646005721fc673ba2624 (diff) | |
download | gnunet-9dd915b5a0b59dfa2589ffc7f8e4ce3b60bdeafb.tar.gz gnunet-9dd915b5a0b59dfa2589ffc7f8e4ce3b60bdeafb.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
Diffstat (limited to 'contrib/ci')
-rwxr-xr-x | contrib/ci/jobs/2-deb-package/version.sh | 19 | ||||
-rwxr-xr-x | contrib/ci/jobs/5-arm64-deb-package/version.sh | 19 |
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 |
2 | set -ex | 2 | set -ex |
3 | 3 | ||
4 | git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags | 4 | BRANCH=$(git name-rev --name-only HEAD) |
5 | RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD) | 5 | if [ -z "${BRANCH}" ]; then |
6 | 6 | exit 1 | |
7 | commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)" | ||
8 | if [ "${commits}" = "0" ]; then | ||
9 | git describe --tag HEAD | ||
10 | else | 7 | else |
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 | ||
12 | fi | 17 | fi |
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 |
2 | set -ex | 2 | set -ex |
3 | 3 | ||
4 | git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags | 4 | BRANCH=$(git name-rev --name-only HEAD) |
5 | RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD) | 5 | if [ -z "${BRANCH}" ]; then |
6 | 6 | exit 1 | |
7 | commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)" | ||
8 | if [ "${commits}" = "0" ]; then | ||
9 | git describe --tag HEAD | ||
10 | else | 7 | else |
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 | ||
12 | fi | 17 | fi |