-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- git: | ||
local-name: yp-spur | ||
uri: https://github.com/openspur/yp-spur.git | ||
version: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o verbose | ||
|
||
sudo apt-get -qq update | ||
sudo apt-get install -y liblz4-tool | ||
|
||
echo ${DOCKER_CACHE_FILE} | ||
|
||
if [ -f ${DOCKER_CACHE_FILE} ]; then | ||
lz4 -dc ${DOCKER_CACHE_FILE} | docker load || true | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o verbose | ||
|
||
if [[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_PULL_REQUEST} == "false" ]]; | ||
then | ||
mkdir -p $(dirname ${DOCKER_CACHE_FILE}) | ||
docker save $(docker history -q ${PACKAGE_NAME}:latest | grep -v '<missing>') | lz4 -zcf - > ${DOCKER_CACHE_FILE} | ||
|
||
echo "------------" | ||
ls -lh $(dirname ${DOCKER_CACHE_FILE}) | ||
echo "------------" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o verbose | ||
|
||
echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s overlay2"' \ | ||
| sudo tee /etc/default/docker > /dev/null | ||
sudo service docker restart | ||
|
||
sleep 5 | ||
docker info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o verbose | ||
|
||
scriptdir=`dirname "${0}"` | ||
|
||
wget -q -P /tmp https://raw.githubusercontent.com/at-wat/gh-pr-comment/master/gh-pr-comment.sh | ||
source /tmp/gh-pr-comment.sh | ||
|
||
source /opt/ros/${ROS_DISTRO}/setup.bash | ||
source /catkin_ws/devel/setup.bash | ||
|
||
cd /catkin_ws | ||
|
||
if [ -f $scriptdir/deps.rosinstall ]; | ||
then | ||
wstool init src $scriptdir/deps.rosinstall | ||
fi | ||
|
||
apt-get -qq update && \ | ||
apt-get install libxml2-utils && \ | ||
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
catkin_make || (gh-pr-comment FAILED '```catkin_make``` failed'; false) | ||
catkin_make tests --cmake-args -DMCL_3DL_EXTRA_TESTS:=ON || (gh-pr-comment FAILED '```catkin_make tests``` failed'; false) | ||
catkin_make run_tests --cmake-args -DMCL_3DL_EXTRA_TESTS:=ON || (gh-pr-comment FAILED '```catkin_make run_tests``` failed'; false) | ||
|
||
if [ catkin_test_results ]; | ||
then | ||
result_text=" | ||
\`\`\` | ||
`catkin_test_results --all || true` | ||
\`\`\` | ||
" | ||
else | ||
result_text=" | ||
\`\`\` | ||
`catkin_test_results --all || true` | ||
\`\`\` | ||
`find build/test_results/ -name *.xml | xargs -n 1 -- bash -c 'echo; echo \#\#\# $0; echo; echo \\\`\\\`\\\`; xmllint --format $0; echo \\\`\\\`\\\`;'` | ||
" | ||
fi | ||
catkin_test_results || (gh-pr-comment FAILED "Test failed$result_text"; false) | ||
|
||
gh-pr-comment PASSED "All tests passed$result_text" | ||
|
||
cd .. | ||
rm -rf /catkin_ws || true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
sudo: required | ||
services: docker | ||
|
||
cache: | ||
directories: | ||
- /home/travis/docker/ | ||
env: | ||
global: | ||
- DOCKER_CACHE_FILE=/home/travis/docker/cache.tar.lz4 | ||
- PACKAGE_NAME=ypspur_ros | ||
branches: | ||
only: | ||
- master | ||
|
||
before_install: | ||
- .travis.scripts/setup_docker.sh | ||
- .travis.scripts/load_cache.sh | ||
|
||
install: true | ||
|
||
script: | ||
- docker build -t ${PACKAGE_NAME}:latest --pull=true ${TRAVIS_BUILD_DIR} --build-arg TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} --build-arg TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG} --build-arg TRAVIS_BOT_GITHUB_TOKEN=${TRAVIS_BOT_GITHUB_TOKEN} | ||
- .travis.scripts/save_cache.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM ros:kinetic | ||
|
||
RUN apt-get -qq update && \ | ||
apt-get install -y --no-install-recommends sudo wget curl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN rosdep update && \ | ||
mkdir -p /catkin_ws/src && \ | ||
bash -c "cd /catkin_ws/src && . /opt/ros/${ROS_DISTRO}/setup.bash && catkin_init_workspace && cd .. && catkin_make" | ||
|
||
ARG TRAVIS_PULL_REQUEST=false | ||
ARG TRAVIS_REPO_SLUG="" | ||
ARG TRAVIS_BOT_GITHUB_TOKEN="" | ||
|
||
ENV TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST | ||
ENV TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG | ||
ENV TRAVIS_BOT_GITHUB_TOKEN=$TRAVIS_BOT_GITHUB_TOKEN | ||
|
||
COPY ./ /catkin_ws/src/$PACKAGE_NAME | ||
RUN /catkin_ws/src/$PACKAGE_NAME/.travis.scripts/test.sh |