|
2 | 2 |
|
3 | 3 | set -ex
|
4 | 4 |
|
5 |
| -apt-get update -qq && apt-get install -y -q wget sudo lsb-release gnupg git sed build-essential # for docker |
| 5 | +apt-get update -qq && apt-get install -y -q wget sudo lsb-release gnupg git sed build-essential ca-certificates # for docker |
6 | 6 | echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
|
7 | 7 |
|
8 | 8 | echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
|
9 |
| -sudo sh -c "echo \"deb ${REPOSITORY} `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list" |
10 |
| -wget http://packages.ros.org/ros.key -O - | sudo apt-key add - |
11 |
| -sudo apt-get update -qq |
12 | 9 |
|
13 | 10 | # Install ROS
|
14 |
| -if [[ "$ROS_DISTRO" == "noetic" ]]; then |
15 |
| - sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon python-is-python3 |
| 11 | +if [[ "$ROS_DISTRO" == "one" ]]; then |
| 12 | + ${CI_SOURCE_PATH}/configure.sh |
16 | 13 | else
|
17 |
| - sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator |
| 14 | + sudo sh -c "echo \"deb ${REPOSITORY} `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list" |
| 15 | + wget http://packages.ros.org/ros.key -O - | sudo apt-key add - |
| 16 | + sudo apt-get update -qq |
| 17 | + |
| 18 | + if [[ "$ROS_DISTRO" == "noetic" ]]; then |
| 19 | + sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon python-is-python3 |
| 20 | + else |
| 21 | + sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator |
| 22 | + fi |
| 23 | + sudo apt-get install -y -q ros-$ROS_DISTRO-catkin |
| 24 | + |
| 25 | + # Setup for rosdep |
| 26 | + sudo rosdep init |
| 27 | + rosdep update --include-eol-distros |
18 | 28 | fi
|
19 |
| -sudo apt-get install -y -q ros-$ROS_DISTRO-catkin |
20 | 29 |
|
21 |
| -source /opt/ros/${ROS_DISTRO}/setup.bash |
22 | 30 |
|
23 |
| -# Setup for rosdep |
24 |
| -sudo rosdep init |
25 |
| -# use snapshot of rosdep list |
26 |
| - # https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517 |
27 |
| -if [[ "$ROS_DISTRO" = "kinetic" ]]; then |
28 |
| - sudo rm /etc/ros/rosdep/sources.list.d/20-default.list |
29 |
| - sudo wget https://gist.githubusercontent.com/cottsay/b27a46e53b8f7453bf9ff637d32ea283/raw/476b3714bb90cfbc6b8b9d068162fc6408fa7f76/30-xenial.list -O /etc/ros/rosdep/sources.list.d/30-xenial.list |
30 |
| -fi |
31 |
| -rosdep update --include-eol-distros |
| 31 | +source /opt/ros/${ROS_DISTRO}/setup.bash |
32 | 32 |
|
33 | 33 | # Install source code
|
34 | 34 | mkdir -p ~/catkin_ws/src
|
35 | 35 | cd ~/catkin_ws
|
36 |
| -ln -sf ${CI_SOURCE_PATH} src/${REPOSITORY_NAME} |
| 36 | +cp -r ${CI_SOURCE_PATH} src/${REPOSITORY_NAME} # copy the whole contents instead of create symbolic link |
37 | 37 | wstool init src
|
38 | 38 | wstool merge -t src src/${REPOSITORY_NAME}/aerial_robot_${ROS_DISTRO}.rosinstall
|
39 | 39 | wstool update -t src
|
40 | 40 | rosdep install --from-paths src -y -q -r --ignore-src --rosdistro ${ROS_DISTRO} # -r is indisapensible
|
41 | 41 |
|
42 |
| -if [ ${ROS_DISTRO} = 'kinetic' ]; then |
43 |
| - path=~/.gazebo/models/sun |
44 |
| - echo "manually download the sun gazebo model to ${path}" |
45 |
| - mkdir -p ${path} |
46 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model-1_2.sdf -P ${path} |
47 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model-1_3.sdf -P ${path} |
48 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model-1_4.sdf -P ${path} |
49 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model.sdf -P ${path} |
50 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/sun/model.config -P ${path} |
51 |
| - |
52 |
| - path=~/.gazebo/models/ground_plane |
53 |
| - echo "manually download the ground_plane gazebo model to ${path}" |
54 |
| - mkdir -p ${path} |
55 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model-1_2.sdf -P ${path} |
56 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model-1_3.sdf -P ${path} |
57 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model-1_4.sdf -P ${path} |
58 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model.sdf -P ${path} |
59 |
| - wget https://raw.githubusercontent.com/osrf/gazebo_models/master/ground_plane/model.config -P ${path} |
60 |
| -fi |
61 |
| - |
62 | 42 | # Build
|
63 | 43 | catkin config --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
64 |
| -catkin build -p1 -j1 --no-status |
| 44 | +catkin build --no-status |
65 | 45 | catkin build --catkin-make-args run_tests -- -i --no-deps --no-status -p 1 -j 1 aerial_robot
|
66 | 46 | catkin_test_results --verbose build || catkin_test_results --all build
|
0 commit comments