Skip to content

Commit

Permalink
Merge pull request #75 from osrf/eol_rosdep
Browse files Browse the repository at this point in the history
add snippet for bootstrapping rosdep
  • Loading branch information
mikaelarguedas authored Oct 22, 2019
2 parents 2e5448a + 44c0596 commit 52644ee
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docker_templates/eol_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

def isDistroEOL(ros_distro_name, os_distro_name):

def isDistroEOL(*, ros_distro_name=None, os_distro_name=None):
eol_ros_distros = [
# ROS 1
'boxturtle',
Expand Down
2 changes: 1 addition & 1 deletion docker_templates/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def expandPackages(data):
ros_distro_name = data['rosdistro_name']
elif package_type == 'ros2_packages':
ros_distro_name = data['ros2distro_name']
eol = isDistroEOL(ros_distro_name, data['os_code_name'])
eol = isDistroEOL(ros_distro_name=ros_distro_name, os_distro_name=data['os_code_name'])
if eol:
package_index_url_template = indexUrlTemplateLookup[package_type + '_snapshots']
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ template_dependencies = [
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# bootstrap rosdep
RUN rosdep init \
&& rosdep update
@(TEMPLATE(
'snippet/bootstrap_rosdep.Dockerfile.em',
os_code_name=os_code_name,
rosdistro_name=rosdistro_name,
ros_version=ros_version,
))@

# install ros packages
ENV ROS_DISTRO @rosdistro_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ if 'pip3_install' in locals():
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# bootstrap rosdep
RUN rosdep init \
&& rosdep update
@(TEMPLATE(
'snippet/bootstrap_rosdep.Dockerfile.em',
os_code_name=os_code_name,
ros2distro_name=ros2distro_name,
ros_version=ros_version,
))@

# setup colcon mixin and metadata
RUN colcon mixin add default \
Expand Down
15 changes: 15 additions & 0 deletions docker_templates/templates/snippet/bootstrap_rosdep.Dockerfile.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@{
rosdep_update_args = []
from docker_templates.eol_distro import isDistroEOL
if int(ros_version) == 2:
ros_distro_name = ros2distro_name
elif int(ros_version) == 1:
ros_distro_name = rosdistro_name

if isDistroEOL(ros_distro_name=ros_distro_name):
rosdep_update_args.append('--include-eol-distros')
}@
# bootstrap rosdep
RUN rosdep init \
&& rosdep update@('' if rosdep_update_args == [] else ' ' + ' \\\n '.join(rosdep_update_args))@

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if int(ros_version) == 2:
elif int(ros_version) == 1:
ros_distro_name = rosdistro_name

if isDistroEOL(ros_distro_name, os_code_name):
if isDistroEOL(ros_distro_name=ros_distro_name, os_distro_name=os_code_name):
repo_url = os.path.join(
'http://snapshots.ros.org',
str(ros_distro_name),
Expand Down

0 comments on commit 52644ee

Please sign in to comment.