From 2d1d09ac29d4859b89fc5896bdefbc5dc74cfe07 Mon Sep 17 00:00:00 2001 From: Deepak Khatri <lorforlinux@beagleboard.org> Date: Tue, 27 Jun 2023 15:16:13 +0530 Subject: [PATCH] WIP: fix GIT_BRANCH CI variable issue --- gitlab-build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitlab-build.sh b/gitlab-build.sh index b57721f4..37d74f2f 100755 --- a/gitlab-build.sh +++ b/gitlab-build.sh @@ -83,7 +83,9 @@ elif [ "$CI_COMMIT_TAG" != "" ]; then export VERSION_MAJOR=${TAG_VER[0]} export VERSION_MINOR=${TAG_VER[1]} export EXTRAVERSION=${TAG_SPLIT[1]} - export GIT_BRANCH=$(git branch -a --contains tags/$CI_COMMIT_TAG | grep origin | head -1 | sed 's/.*origin\///') + # export GIT_BRANCH=$(git branch -a --contains tags/$CI_COMMIT_TAG | grep origin | head -1 | sed 's/.*origin\///') + if ["$PROJECT_BRANCH" != ""]; then export GIT_BRANCH=$PROJECT_BRANCH; else export GIT_BRANCH=$CI_DEFAULT_BRANCH; fi + if [ "$GIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then export VER_DIR=latest export PAGES_URL=https://docs.beagleboard.org -- GitLab