Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Templates/GitlabCIPipeline-for-distributed-runner/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,18 @@ Packaging:

if [ ${RC} -ne 0 ]; then
echo [ERROR] Failed to compute the next release version. Exit code: ${RC}.
echo [ERROR] Error message from the computeReleaseVersion script is
echo ${stringOut}
fi

if [ ${RC} -eq 0 ]; then
# Extract the next release version.
export releaseVersion=$(echo "${stringOut}" | grep "The next release version:" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

if [ "${releaseVersion}" == "" ]; then
if [ -z "${releaseVersion}" ]; then
RC=8
echo [ERROR] Failed to extract the release version from the output of computeReleaseVersion script. Exit code: ${RC}.
echo [ERROR] Error message from the computeReleaseVersion script is
echo ${stringOut}
fi
fi
Expand Down Expand Up @@ -273,16 +275,18 @@ Packaging:

if [ ${RC} -ne 0 ]; then
echo [ERROR] Failed to compute the next release version. Exit code: ${RC}.
echo [ERROR] Error message from the computeReleaseVersion script is
echo ${stringOut}
fi

if [ ${RC} -eq 0 ]; then
# Extract the next release version.
export releaseVersion=$(echo "${stringOut}" | grep "The next release version:" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

if [ "${releaseVersion}" == "" ]; then
if [ -z "${releaseVersion}" ]; then
RC=8
echo [ERROR] Failed to extract the release version from the output of computeReleaseVersion script. Exit code: ${RC}.
echo [ERROR] Error message from the computeReleaseVersion script is
echo ${stringOut}
fi
fi
Expand Down Expand Up @@ -687,6 +691,7 @@ Packaging:

if [ ${RC} -ne 0 ]; then
echo [ERROR] Failed to compute the next release version. Exit code: ${RC}.
echo [ERROR] Error message from the computeReleaseVersion script is
echo ${stringOut}
fi

Expand All @@ -695,9 +700,10 @@ Packaging:
export releaseVersion=$(echo "${stringOut}" | grep "The next release version:" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
export currentBaselineVersion=$(echo "${stringOut}" | grep "Baseline reference:" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

if [ "${releaseVersion}" == "" || "${currentBaselineVersion}" == "" ]; then
if [ -z "${releaseVersion}" ] || [ -z "${currentBaselineVersion}" ]; then
RC=8
echo [ERROR] Failed to extract the release version or the current baseline version from the output of computeReleaseVersion script. Exit code: ${RC}.
echo [ERROR] Error message from the computeReleaseVersion script is
echo ${stringOut}
fi
fi
Expand All @@ -717,13 +723,13 @@ Packaging:


baselineReferenceFile=$(find ${CI_PROJECT_DIR} -name baselineReference.config)
if [ "${baselineReferenceFile}" == "" ]; then
if [ -z "${baselineReferenceFile}" ]; then
RC=8
echo [ERROR] Unable to locate the baselineReference.config file. Exit code: ${RC}.
fi

if [ ${RC} -eq 0 ]; then
if [ ${CI_COMMIT_BRANCH} == "main" && ${RC} ]; then
if [ ${CI_COMMIT_BRANCH} == "main" ]; then
echo [INFO] Update baselineReference.config file to set baseline references for the branches main and release/${releaseVersion}
sed -i "s/main=refs\/tags\/${currentBaselineVersion}/main=refs\/tags\/${releaseVersion}/" ${baselineReferenceFile}
sed -i "/^release.*${currentBaselineVersion}/a release\/${releaseVersion}=refs\/tags\/${releaseVersion}" ${baselineReferenceFile}
Expand Down