Skip to content

Commit

Permalink
Bugfix, forbidden path outside build context
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Mar 5, 2021
1 parent 0f72f1d commit fce25b9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Build and test
uses: threeal/ros2-ci@v0.2.0
uses: threeal/ros2-ci@v0.2.1
with:
ros2-distro: foxy
```
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM docker:latest

COPY ../ros2 /ros2
COPY ros2 /ros2

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

cp -r "${GITHUB_REPOSITORY}" "/ros/${GITHUB_WORKSPACE}"

docker build \
--build-args ROS2_DISTRO="$1" \
--build-args GITHUB_WORKSPACE="$GITHUB_WORKSPACE" \
--build-args GITHUB_REPOSITORY="$GITHUB_REPOSITORY" \
-t ros2-ci:latest /ros2 || exit $?

docker run --rm ros2-ci:latest || exit $?
12 changes: 12 additions & 0 deletions docker/ros2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG ROS2_DISTRO=foxy

FROM ros:${ROS2_DISTRO}

ARG ROS2_DISTRO

COPY . /ws

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
4 changes: 2 additions & 2 deletions ros2/entrypoint.sh → docker/ros2/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

source /opt/ros/${ROS2_DISTRO}/setup.sh || exit $?

cd ws && colcon build \
cd /ws && colcon build \
--event-handlers console_cohesion+ \
--cmake-args \
--symlink-install || exit $?

cd ws && colcon test \
cd /ws && colcon test \
--event-handlers console_cohesion+ \
--pytest-with-coverage \
--return-code-on-test-failure || exit $?
15 changes: 0 additions & 15 deletions ros2/Dockerfile

This file was deleted.

0 comments on commit fce25b9

Please sign in to comment.