Skip to content

Commit

Permalink
Fix reading output from docker (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh authored Apr 29, 2024
2 parents 3b1bf9a + 601be28 commit 58854fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.2
1.24.3
4 changes: 2 additions & 2 deletions ci/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
done

echo -e "\e[35m\e[1mPACKAGE = ${PACKAGE}\e[0m"
ROS_VERSION=$(docker exec -t tue-env bash -c 'source ~/.bashrc; echo "${ROS_VERSION}"' | tr -d '\r')
ROS_VERSION=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${ROS_VERSION}"' | tr -d '\r')
echo -e "\e[35m\e[1mROS_VERSION = ${ROS_VERSION}\e[0m"

# If packages is non-zero, this is a multi-package repo. In multi-package repo, check if this package needs CI.
Expand All @@ -53,7 +53,7 @@ then
docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}"/src/"${PACKAGE}" && /usr/bin/python3 "$(command -v catkin)" build --this --no-status -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=OFF'
else
echo -e "\e[35m\e[1mCheck for default mixin repo (colcon mixin list)\e[0m"
MIXIN_REPOS=$(docker exec -t tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon mixin list | grep -v "^- "' | tr -d '\r' | awk -F ": " '{print $1}')
MIXIN_REPOS=$(docker exec tue-env bash -c 'source ~/.bashrc; cd "${TUE_SYSTEM_DIR}" && colcon mixin list | grep -v "^- "' | tr -d '\r' | awk -F ": " '{print $1}')
if ! echo -e "${MIXIN_REPOS}" | grep "^default$" -q
then
echo -e "\e[35m\e[1mAdd the default mixin repo (colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml)\e[0m"
Expand Down
10 changes: 7 additions & 3 deletions ci/install-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ then
BRANCH_TAG=$MASTER_TAG
fi

DOCKER_HOME=$(docker run --name tue-env --rm "$IMAGE_NAME:$BRANCH_TAG" bash -c 'echo "$HOME"' | tr -d '\r')
# Docker container can show a header on start-up. We don't want to capture it
docker run --detach --tty --name tue-env "${IMAGE_NAME}:${BRANCH_TAG}"
DOCKER_HOME=$(docker exec tue-env bash -c 'echo "${HOME}"' | tr -d '\r')
docker stop tue-env &> /dev/null || true
docker rm tue-env &> /dev/null || true

# Make sure the ~/.ccache folder exists
mkdir -p "$HOME"/.ccache
Expand Down Expand Up @@ -204,10 +208,10 @@ fi
# Catch the ROS_DISTRO of the docker container
# stip carriage return from docker output by "tr -d '\r'"
# see https://unix.stackexchange.com/a/487185
ROS_DISTRO=$(docker exec -t tue-env bash -c 'source ~/.bashrc; echo "$ROS_DISTRO"' | tr -d '\r')
ROS_DISTRO=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${ROS_DISTRO}"' | tr -d '\r')
echo -e "\e[35m\e[1mROS_DISTRO = ${ROS_DISTRO}\e[0m"

TUE_SYSTEM_DIR=$(docker exec -t tue-env bash -c 'source ~/.bashrc; echo "$TUE_SYSTEM_DIR"' | tr -d '\r')
TUE_SYSTEM_DIR=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${TUE_SYSTEM_DIR}"' | tr -d '\r')

# First install only the git repo of the package so that appropriate branch can be checked out later
echo -e "\e[35m\e[1mtue-get install ros-$PACKAGE --no-ros-deps\e[0m"
Expand Down
2 changes: 1 addition & 1 deletion ci/test-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
done

echo -e "\e[35m\e[1mPACKAGE = ${PACKAGE}\e[0m"
ROS_VERSION=$(docker exec -t tue-env bash -c 'source ~/.bashrc; echo "${ROS_VERSION}"' | tr -d '\r')
ROS_VERSION=$(docker exec tue-env bash -c 'source ~/.bashrc; echo "${ROS_VERSION}"' | tr -d '\r')
echo -e "\e[35m\e[1mROS_VERSION = ${ROS_VERSION}\e[0m"

# If packages is non-zero, this is a multi-package repo. In multi-package repo, check if this package needs CI.
Expand Down

0 comments on commit 58854fd

Please sign in to comment.