Skip to content

Commit

Permalink
Move common entry point for CE build from .travis.yml to a script
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Rodriguez Hortala authored and juanrh committed Feb 27, 2019
1 parent acf8397 commit 56806b0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ce_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# create a shared mount point to put coverage report
mkdir shared/
# move travis scripts to share mount so they can be executed within the docker container
cp -r ${SCRIPT_DIR} shared/
# get a docker container from OSRF's docker hub
docker pull ros:"$ROS_DISTRO"-ros-core
# run docker container
docker run -v "$PWD/shared:/shared" -e ROS_DISTRO="$ROS_DISTRO" \
-e PACKAGE_NAME="$PACKAGE_NAME" \
-e ROS_VERSION="$ROS_VERSION" \
-e NO_TEST="$NO_TEST" \
--name "$ROS_DISTRO"-container \
-dit ros:"$ROS_DISTRO"-ros-core /bin/bash
# make a workspace in the docker container
docker exec "$ROS_DISTRO"-container /bin/bash -c 'mkdir -p /"$ROS_DISTRO"_ws/src'
# copy the code over to the docker container
docker cp $TRAVIS_BUILD_DIR "$ROS_DISTRO"-container:/"$ROS_DISTRO"_ws/src/
# execute build scripts and run test
docker exec "$ROS_DISTRO"-container /bin/bash \
-c "sh /shared/$(basename ${SCRIPT_DIR})/"'ros"$ROS_VERSION"_build.sh' || travis_terminate 1;
# upload coverage report to codecov
bash <(curl -s https://codecov.io/bash) -Z
Empty file modified ros1_build.sh
100644 → 100755
Empty file.
Empty file modified ros1_sa_build.sh
100644 → 100755
Empty file.
Empty file modified ros2_build.sh
100644 → 100755
Empty file.

0 comments on commit 56806b0

Please sign in to comment.