Skip to content

Commit 68941fd

Browse files
committed
brew CI: check RTOOLS_BRANCH for ci_matching_branch
Signed-off-by: Steve Peters <scpeters@intrinsic.ai>
1 parent a0d3516 commit 68941fd

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,24 @@ echo '# BEGIN SECTION: setup the osrf/simulation tap'
5656
brew tap osrf/simulation
5757
echo '# END SECTION'
5858

59+
# check if github pull request source branch starts with ci_matching_branch/
5960
if [[ -n "${ghprbSourceBranch}" ]] && \
6061
python3 ${SCRIPT_DIR}/tools/detect_ci_matching_branch.py "${ghprbSourceBranch}"
6162
then
62-
echo "# BEGIN SECTION: trying to checkout branch ${ghprbSourceBranch} from osrf/simulation"
63+
export CI_MATCHING_BRANCH=${ghprbSourceBranch}
64+
# otherwise check if release-tools branch starts with ci_matching_branch/
65+
elif [[ -n "${RTOOLS_BRANCH}" ]] && \
66+
python3 ${SCRIPT_DIR}/tools/detect_ci_matching_branch.py "${RTOOLS_BRANCH}"
67+
then
68+
export CI_MATCHING_BRANCH=${RTOOLS_BRANCH}
69+
fi
70+
71+
if [[ -n "${CI_MATCHING_BRANCH}" ]]
72+
then
73+
echo "# BEGIN SECTION: trying to checkout branch ${CI_MATCHING_BRANCH} from osrf/simulation"
6374
pushd $(brew --repo osrf/simulation)
64-
git fetch origin ${ghprbSourceBranch} || true
65-
git checkout ${ghprbSourceBranch} || true
75+
git fetch origin ${CI_MATCHING_BRANCH} || true
76+
git checkout ${CI_MATCHING_BRANCH} || true
6677
popd
6778
echo '# END SECTION'
6879
fi

0 commit comments

Comments
 (0)