Skip to content

Commit

Permalink
run command after starting the container
Browse files Browse the repository at this point in the history
  • Loading branch information
3473f committed Sep 10, 2023
1 parent 304f2a2 commit 0a20a51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ RUN source /opt/ros/$ROS_DISTRO/setup.bash && \

# Copy ros_entrypoint.sh
COPY --chmod=0755 ros_entrypoint.sh /ros_entrypoint.sh
ENTRYPOINT [ "/ros_entrypoint.sh" ]
ENTRYPOINT [ "/ros_entrypoint.sh" ]

RUN mkdir /output
WORKDIR /output
14 changes: 12 additions & 2 deletions ros_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@ source "/opt/ros/$ROS_DISTRO/setup.bash"
source "/colcon_ws/install/setup.bash"
exec "$@"

# run help
ros2 autodoc -h
# run ros2autodoc
if [[ -z "$package_name" ]]; then
if [[ -z "$node_name" ]]; then
echo "No nodes are provided. Exiting container."
else
ros2 autodoc $node_name
fi
elif [[ -z "$node_name" ]]; then
echo "No nodes are provided. Exiting container."
else
ros2 autodoc $node_name --package-name $package_name
fi

0 comments on commit 0a20a51

Please sign in to comment.