Skip to content

Commit

Permalink
Only use matching branch in gzdev if the branch actually exists (#1240)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Jan 17, 2025
1 parent 84552c6 commit c1afa84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jenkins-scripts/docker/lib/docker_generate_dockerfile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ ADD https://api.github.com/repos/gazebo-tooling/gzdev/git/refs/heads/$GZDEV_BRAN
RUN rm -fr ${GZDEV_DIR} \
&& git clone https://github.com/gazebo-tooling/gzdev -b ${GZDEV_BRANCH} ${GZDEV_DIR}
DELIM_OSRF_REPO_GIT_1
if [ -n $GZDEV_TRY_BRANCH ]; then
GZDEV_TRY_BRANCH_URL="https://api.github.com/repos/gazebo-tooling/gzdev/git/refs/heads/$GZDEV_TRY_BRANCH"
if [ -n $GZDEV_TRY_BRANCH ] && curl --output /dev/null --silent --head --fail $GZDEV_TRY_BRANCH_URL; then
cat >> Dockerfile << DELIM_OSRF_REPO_GIT_2
ADD https://api.github.com/repos/gazebo-tooling/gzdev/git/refs/heads/$GZDEV_TRY_BRANCH version.json
ADD $GZDEV_TRY_BRANCH_URL version.json
RUN git -C ${GZDEV_DIR} fetch origin $GZDEV_TRY_BRANCH || true;
RUN git -C ${GZDEV_DIR} checkout $GZDEV_TRY_BRANCH || true;
DELIM_OSRF_REPO_GIT_2
Expand Down

0 comments on commit c1afa84

Please sign in to comment.