Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
codygarver committed Dec 24, 2022
1 parent 02accf0 commit 678854a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
11 changes: 5 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
environment:
TERM: xterm # use xterm to get full display output from build
INIT_ENV: /home/carma/.base-image/init-env.sh
ROS_2_ENV: /opt/ros/foxy/setup.bash
ROS_1_ENV: /opt/ros/noetic/setup.bash
working_directory: "/opt/carma/"
# Execution steps
steps:
Expand All @@ -51,20 +51,19 @@ jobs:
command: |
source ${INIT_ENV}
./src/CARMASscInterfaceWrapper/docker/checkout.bash --ros1_build -r ${PWD}
sed -i '/colcon build/ s/$/ --packages-up-to ssc_interface_wrapper_ros2 pacmod3 kvaser_interface/' ~/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
sudo apt update
sudo apt -y install ros-foxy-pacmod3
./src/CARMASscInterfaceWrapper/docker/install.sh "$ACCESS_ID" "$SECRET_KEY" --ros1_build
sed -i '/colcon build/ s/$/ --packages-up-to ssc_interface_wrapper/' ~/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
- run:
name: Build Driver
command: |
source ${INIT_ENV}
source ${ROS_2_ENV}
source ${ROS_1_ENV}
make_with_coverage.bash -m -e /opt/carma/ -o ./coverage_reports/gcov
- run:
name: Run C++ Tests
command: |
source ${INIT_ENV}
source ${ROS_2_ENV}
source ${ROS_1_ENV}
make_with_coverage.bash -t -e /opt/carma/ -o ./coverage_reports/gcov
# Run SonarCloud analysis
# PR Branchs and number extracted from Circle variables and github api
Expand Down
36 changes: 25 additions & 11 deletions docker/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,22 @@ while [[ $# -gt 0 ]]; do
arg="$1"
case $arg in
-ros1|--ros1_build)
dir=~/workspace_ros1
if [[ "$CI" == "true" ]]; then
dir=/opt/carma
else
dir=~/workspace_ros1
fi
echo "Install and build ros1 packages"
build_ros1_pkgs="$true"
build_ros2_pkgs="$false"
shift
;;
-ros2|--ros2_build)
dir=~/workspace_ros2
if [[ "$CI" == "true" ]]; then
dir=/opt/carma
else
dir=~/workspace_ros2
fi
echo "Install and build ros2 packages"
build_ros1_pkgs="$false"
build_ros2_pkgs="$true"
Expand Down Expand Up @@ -60,9 +68,11 @@ if [ -z $secret_key ];
exit 1
fi

sudo apt-get update

if [ $build_ros1_pkgs -eq 1 ]; then
# ROS1 build and install
cd ~/workspace_ros1
cd "$dir" || exit 1
echo "ROS1 build"
source /home/carma/catkin/setup.bash
source /opt/autoware.ai/ros/install/setup.bash
Expand All @@ -72,8 +82,10 @@ if [ $build_ros1_pkgs -eq 1 ]; then
sudo apt-get install ros-noetic-pacmod-msgs

sudo apt-get install python3-catkin-pkg
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --install-base /opt/carma/install
chmod -R ugo+x /opt/carma/install
if [ -z "$CI" ]; then
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --install-base /opt/carma/install
chmod -R ugo+x /opt/carma/install
fi
unset ROS_LANG_DISABLE

# Get the exit code from the ROS1 build so we can skip the ROS2 build if the ROS1 build failed
Expand All @@ -88,15 +100,15 @@ if [ $build_ros1_pkgs -eq 1 ]; then

elif [ $build_ros2_pkgs -eq 1 ]; then

cd ~/workspace_ros2
cd "$dir" || exit 1
source /opt/autoware.ai/ros/install_ros2/setup.bash
sudo apt-get update
sudo apt-get install -y apt-utils
sudo apt-get install ros-foxy-pacmod-msgs
sudo apt-get install ros-foxy-pacmod3-msgs

colcon build --packages-up-to ssc_interface_wrapper_ros2 pacmod3 kvaser_interface --build-base ./build_ssc_interface_wrapper --install-base /opt/carma/install_ros2 --cmake-args -DCMAKE_BUILD_TYPE=Release

if [ -z "$CI" ]; then
colcon build --packages-up-to ssc_interface_wrapper_ros2 pacmod3 kvaser_interface --build-base ./build_ssc_interface_wrapper --install-base /opt/carma/install_ros2 --cmake-args -DCMAKE_BUILD_TYPE=Release
fi
# Get the exit code from the ROS2 build
status=$?

Expand All @@ -108,9 +120,11 @@ elif [ $build_ros2_pkgs -eq 1 ]; then
exit #Success building ros2 pkgs
fi

cd ~
if [[ "$CI" == "true" ]]; then
exit
fi

source /opt/autoware.ai/ros/install_ros2/setup.bash
sudo apt-get update
sudo apt-get -qq install apt-transport-s3

sudo sh -c 'echo "AccessKeyId = '$access_id'" > /etc/apt/s3auth.conf'
Expand Down

0 comments on commit 678854a

Please sign in to comment.