Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add snippet for bootstrapping rosdep #75

Merged
merged 2 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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