From 339a0f7b90e256deb519229a5e7beb9eb2aca3ea Mon Sep 17 00:00:00 2001 From: "Cezar.Leahu" Date: Wed, 26 Aug 2020 15:18:52 +0300 Subject: [PATCH] ACS-457: Build linkage, tagging and release - add validation on release jobs for the latest upstream tag --- scripts/travis/build_functions.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/travis/build_functions.sh b/scripts/travis/build_functions.sh index f37febfe6b..305d60da3c 100644 --- a/scripts/travis/build_functions.sh +++ b/scripts/travis/build_functions.sh @@ -111,3 +111,18 @@ function pullAndBuildSameBranchOnUpstream() { popd } +function retieveLatestTag() { + local REPO="${1}" + local BRANCH="${2}" + + local LOCAL_PATH="/tmp/$(basename "${REPO%.git}")" + + git clone -q -b "${BRANCH}" "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REPO}" "${LOCAL_PATH}" + + pushd "${LOCAL_PATH}" >/dev/null + git describe --abbrev=0 --tags + popd >/dev/null + + rm -rf "${LOCAL_PATH}" +} +