Skip to content

Commit

Permalink
Merge pull request moby#47028 from vvoland/ci-mobybin-strip-tag-v
Browse files Browse the repository at this point in the history
 hack/make: Strip "v" tag prefix name from VERSION
  • Loading branch information
thaJeztah authored Jan 5, 2024
2 parents c3c1ee0 + dd41f86 commit 6b1baf8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ DEFAULT_BUNDLES=(
)

VERSION=${VERSION:-dev}
if [[ $VERSION == refs/tags/* ]]; then
VERSION=${VERSION#refs/tags/}
elif [[ $VERSION == refs/heads/* ]]; then
VERSION=$(sed <<< "${VERSION#refs/heads/}" -r 's#/+#-#g')
elif [[ $VERSION == refs/pull/* ]]; then
VERSION=pr-$(grep <<< "$VERSION" -o '[0-9]\+')
fi
case "$VERSION" in
refs/tags/v*) VERSION=${VERSION#refs/tags/v} ;;
refs/tags/*) VERSION=${VERSION#refs/tags/} ;;
refs/heads/*) VERSION=$(echo "${VERSION#refs/heads/}" | sed -r 's#/+#-#g') ;;
refs/pull/*) VERSION=pr-$(echo "$VERSION" | grep -o '[0-9]\+') ;;
esac

! BUILDTIME=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
if [ "$DOCKER_GITCOMMIT" ]; then
Expand Down

0 comments on commit 6b1baf8

Please sign in to comment.