Skip to content

Commit 5dbf05c

Browse files
committed
travis: Dockerize pipeline
1 parent 1ade8be commit 5dbf05c

1 file changed

Lines changed: 16 additions & 30 deletions

File tree

.travis.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
1-
sudo: required
2-
dist: trusty
1+
os: linux
2+
dist: bionic
33
language: generic
4-
compiler:
5-
- gcc
4+
services:
5+
- docker
66
env:
7-
global:
8-
- CATKIN_WS=~/catkin_ws
9-
- CATKIN_WS_SRC=${CATKIN_WS}/src
107
matrix:
11-
- CI_ROS_DISTRO="indigo"
12-
- CI_ROS_DISTRO="jade"
13-
14-
branches:
15-
only:
16-
- master
17-
- develop
8+
- CI_ROS_DISTRO="kinetic"
9+
- CI_ROS_DISTRO="melodic"
10+
- CI_ROS_DISTRO="noetic"
1811

1912
install:
20-
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
21-
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
22-
- sudo apt-get update -qq
23-
- sudo apt-get install -qq -y python-rosdep python-catkin-tools
24-
- sudo rosdep init
25-
- rosdep update
26-
- rosdep install --from-paths ./ -i -y --rosdistro $CI_ROS_DISTRO
13+
- docker pull ros:${CI_ROS_DISTRO}-ros-core
14+
- docker run --name ci_runner -i -d --rm -v $(pwd):/catkin_ws/src ros:${CI_ROS_DISTRO}-ros-core
15+
- if [ "${CI_ROS_DISTRO}" == "noetic" ]; then docker exec ci_runner /bin/bash -c "apt update; apt install -y python3-rosdep python3-catkin-tools python3-osrf-pycommon"; fi
16+
- if [ "${CI_ROS_DISTRO}" != "noetic" ]; then docker exec ci_runner /bin/bash -c "apt update; apt install -y python-rosdep python-catkin-tools"; fi
17+
- docker exec ci_runner /bin/bash -c "source ./ros_entrypoint.sh; rosdep init; rosdep update; rosdep install --from-paths /catkin_ws/src --ignore-src -y"
2718

2819
script:
29-
- source /opt/ros/$CI_ROS_DISTRO/setup.bash
30-
- mkdir -p $CATKIN_WS_SRC
31-
- ln -s $TRAVIS_BUILD_DIR $CATKIN_WS_SRC
32-
- cd $CATKIN_WS
33-
- catkin init
34-
- catkin config --install
35-
- catkin build --limit-status-rate 0.1 --no-notify -DCMAKE_BUILD_TYPE=Release
36-
- catkin build --limit-status-rate 0.1 --no-notify --make-args tests
37-
- catkin run_tests
20+
- docker exec ci_runner /bin/bash -c "source ./ros_entrypoint.sh; cd /catkin_ws; catkin init; catkin config --install"
21+
- docker exec ci_runner /bin/bash -c "source ./ros_entrypoint.sh; cd /catkin_ws; catkin build --limit-status-rate 0.1 --no-notify -DCMAKE_BUILD_TYPE=Release"
22+
- docker exec ci_runner /bin/bash -c "source ./ros_entrypoint.sh; cd /catkin_ws; catkin build --limit-status-rate 0.1 --no-notify --make-args tests"
23+
- docker exec ci_runner /bin/bash -c "source ./ros_entrypoint.sh; cd /catkin_ws; catkin run_tests"

0 commit comments

Comments
 (0)