-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from osrf/template_eol
Snippet for setting up APT repos based on if the distro is EOL or not
- Loading branch information
Showing
7 changed files
with
146 additions
and
23 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,53 @@ | ||
# Copyright 2019 Mikael Arguedas | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def isDistroEOL(ros_distro_name, os_distro_name): | ||
eol_ros_distros = [ | ||
# ROS 1 | ||
'boxturtle', | ||
'cturtle', | ||
'diamondback', | ||
'electric', | ||
'fuerte', | ||
'groovy', | ||
'hydro', | ||
'indigo', | ||
'jade', | ||
'lunar', | ||
# ROS 2 | ||
'ardent', | ||
] | ||
eol_base_images = [ | ||
# Ubuntu | ||
'lucid', | ||
'maverick', | ||
'natty', | ||
'oneiric', | ||
'precise', | ||
'quantal', | ||
'raring', | ||
'saucy', | ||
'trusty', | ||
'utopic', | ||
'vivid', | ||
'wily', | ||
'yakkety', | ||
'zesty', | ||
'artful', | ||
'cosmic', | ||
# Debian | ||
'wheezy', | ||
'jessie', | ||
] | ||
return os_distro_name in eol_base_images or ros_distro_name in eol_ros_distros |
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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
docker_templates/templates/snippet/setup_ros_sources.Dockerfile.em
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,32 @@ | ||
@{ | ||
import os | ||
|
||
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, os_code_name): | ||
repo_url = os.path.join( | ||
'http://snapshots.ros.org', | ||
str(ros_distro_name), | ||
'final', | ||
str(os_name) | ||
) | ||
repo_key = 'AD19BAB3CBF125EA' | ||
source_suffix = 'snapshots' | ||
else: | ||
repo_key = 'C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | ||
source_suffix = 'latest' | ||
|
||
if int(ros_version) == 1: | ||
repo_url = 'http://packages.ros.org/ros/ubuntu' | ||
elif int(ros_version) == 2: | ||
repo_url = 'http://packages.ros.org/ros2/ubuntu' | ||
}@ | ||
# setup keys | ||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys @(repo_key) | ||
|
||
# setup sources.list | ||
RUN echo "deb @(repo_url) @(os_code_name) main" > /etc/apt/sources.list.d/ros@(ros_version)-@(source_suffix).list |