Adds arg to set cartographer version for docker build. (#376)
parent
8140946a34
commit
8a6a2216d2
|
@ -14,6 +14,8 @@
|
|||
|
||||
FROM ros:indigo
|
||||
|
||||
ARG CARTOGRAPHER_VERSION=master
|
||||
|
||||
# First, we invalidate the entire cache if googlecartographer/cartographer has
|
||||
# changed. This file's content changes whenever master changes. See:
|
||||
# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
|
||||
|
@ -23,10 +25,8 @@ ADD https://api.github.com/repos/googlecartographer/cartographer/git/refs/heads/
|
|||
# wstool needs the updated rosinstall file to clone the correct repos.
|
||||
COPY cartographer_ros.rosinstall cartographer_ros/
|
||||
COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
|
||||
# Remove the contents of the cartographer_ros repo and copy in the updated
|
||||
# files as necessary.
|
||||
RUN cartographer_ros/scripts/prepare_catkin_workspace.sh && \
|
||||
rm -rf catkin_ws/src/cartographer_ros/*
|
||||
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
|
||||
cartographer_ros/scripts/prepare_catkin_workspace.sh
|
||||
|
||||
# rosdep needs the updated package.xml files to install the correct debs.
|
||||
COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
FROM ros:kinetic
|
||||
|
||||
ARG CARTOGRAPHER_VERSION=master
|
||||
|
||||
# Xenial's base image doesn't ship with sudo.
|
||||
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
@ -26,10 +28,8 @@ ADD https://api.github.com/repos/googlecartographer/cartographer/git/refs/heads/
|
|||
# wstool needs the updated rosinstall file to clone the correct repos.
|
||||
COPY cartographer_ros.rosinstall cartographer_ros/
|
||||
COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
|
||||
# Remove the contents of the cartographer_ros repo and copy in the updated
|
||||
# files as necessary.
|
||||
RUN cartographer_ros/scripts/prepare_catkin_workspace.sh && \
|
||||
rm -rf catkin_ws/src/cartographer_ros/*
|
||||
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
|
||||
cartographer_ros/scripts/prepare_catkin_workspace.sh
|
||||
|
||||
# rosdep needs the updated package.xml files to install the correct debs.
|
||||
COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/
|
||||
|
|
|
@ -20,10 +20,12 @@ set -o verbose
|
|||
. /opt/ros/${ROS_DISTRO}/setup.sh
|
||||
|
||||
# Create a new workspace in 'catkin_ws'.
|
||||
mkdir catkin_ws
|
||||
cd catkin_ws
|
||||
wstool init src
|
||||
mkdir -p catkin_ws/src
|
||||
cd catkin_ws/src
|
||||
wstool init
|
||||
|
||||
# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
|
||||
wstool merge -t src ../cartographer_ros/cartographer_ros.rosinstall
|
||||
wstool update -t src
|
||||
wstool merge ../../cartographer_ros/cartographer_ros.rosinstall
|
||||
wstool set cartographer -v ${CARTOGRAPHER_VERSION} -y
|
||||
wstool remove cartographer_ros
|
||||
wstool update
|
||||
|
|
Loading…
Reference in New Issue