Commit 07d09527 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix float ref branch setting for non-BASOP port branches

parent 62f24784
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ branchname_out="ivas-float-update"

if ! [[ "$branchname_in" =~ $BASOP_PATTERN ]]; then
  printf "$MSG_DOES_NOT_MATCH" "$branchname_in"
  exit 1
fi

# The float ref branch is just the same name, but with basop -> ref replacement
@@ -64,3 +65,4 @@ if [[ "$git_result" =~ "$float_ref_branchname" ]]; then
fi

echo "$branchname_out"
exit 0
+13 −5
Original line number Diff line number Diff line
@@ -7,11 +7,19 @@ cd "${CI_PROJECT_DIR}"
# use ivas-float-update as reference for the merge source per default
FLOAT_REF_BRANCH_MERGE_SOURCE=$FLOAT_REF_BRANCH

exit_code=0
# first check if branch matches the pattern
bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME || exit_code=$?

# run again to actually set the branch name only if the naming pattern is there
# TODO: this is a bit awkward, but needed as a quick fix for now
if [[ "$exit_code" != "0" ]]; then
  if [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]] && [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[CI\] ]]; then
    bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/update-scripts-repo.sh
    # a bit awkward: write to file + standard out first so that the error message is visible in case of failure. Then fill the variable from the file
    bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | tee tmp_ref_branch.txt
    FLOAT_REF_BRANCH_MERGE_SOURCE=$(cat tmp_ref_branch.txt)
  fi
fi

export FLOAT_REF_BRANCH_MERGE_SOURCE