Skip to content

Commit e7e7fd5

Browse files
scpetersj-rivero
andauthored
brew CI: check RTOOLS_BRANCH for ci_matching_branch (#1509)
Signed-off-by: Steve Peters <scpeters@intrinsic.ai> Co-authored-by: Jose Luis Rivero <jrivero@honurobotics.com>
1 parent 661a7bb commit e7e7fd5

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
@@ -57,13 +57,24 @@ brew tap osrf/simulation
5757
brew trust osrf/simulation
5858
echo '# END SECTION'
5959

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

0 commit comments

Comments
 (0)