You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@yetus.apache.org by aw...@apache.org on 2022/05/23 14:15:38 UTC

[yetus] branch main updated: YETUS-1182. ghcr builds for tags don't work (#280)

This is an automated email from the ASF dual-hosted git repository.

aw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new 2e29d3d1 YETUS-1182. ghcr builds for tags don't work (#280)
2e29d3d1 is described below

commit 2e29d3d186967b8e09f4cccd86686314a499fe33
Author: Allen Wittenauer <aw...@apache.org>
AuthorDate: Mon May 23 07:15:34 2022 -0700

    YETUS-1182. ghcr builds for tags don't work (#280)
---
 hooks/build | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hooks/build b/hooks/build
index beea7672..ab8318b8 100755
--- a/hooks/build
+++ b/hooks/build
@@ -89,9 +89,14 @@ fi
 
 if [[ -z "${SOURCE_BRANCH}" ]]; then
   SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
+  if [[ "${SOURCE_BRANCH}" == 'HEAD' ]]; then
+    SOURCE_BRANCH=$(git describe --tags)
+  fi
   export SOURCE_BRANCH
 fi
 
+SOURCE_BRANCH=${SOURCE_BRANCH/rel\//}
+
 if [[ -z "${DOCKER_TAG}" ]]; then
   DOCKER_TAG=${SOURCE_BRANCH}
   export DOCKER_TAG
@@ -123,6 +128,10 @@ if [[ "${BUILDERINSTANCE}" =~ docker-container ]]; then
   PLATARRAY=(--platform "${PLATSTRING}")
 fi
 
+echo
+echo "Building ${DOCKER_REPO}-base:${DOCKER_TAG}"
+echo
+
 opencontainerslabels "base"
 
 # Build the -base image