From 758c8258d8fb011194771f133c8f2640724a80c6 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 11:33:59 +0200 Subject: [PATCH 1/4] Bump docker image build action and add handling branch name arg --- .github/workflows/ros-docker-image.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 2d5b4cd..73f9329 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -4,6 +4,9 @@ name: Build/Publish ROS Docker Image on: workflow_dispatch: inputs: + panther_codebase_version: + description: Version of the panther_ros to be used in the docker image (branch/tag/commit). + required: true build_type: description: Is it a "development" or a "stable" release? required: true @@ -48,13 +51,14 @@ jobs: uses: actions/checkout@v2 - name: Build Docker Image - uses: husarion-ci/ros-docker-img-action@v0.5 + uses: husarion-ci/ros-docker-img-action@v0.6 with: dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} main_branch_name: ros2 dockerfile: ${{ matrix.dockerfile }} repo_name: ${{ matrix.repo_name }} + branch_name: ${{ inputs.panther_codebase_version }} build_type: ${{ inputs.build_type }} ros_distro: ${{ matrix.ros_distro }} platforms: ${{ matrix.platforms }} From c0614f0565090949ff8f09c017b55aaae4f80590 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 11:35:58 +0200 Subject: [PATCH 2/4] Add type and default value --- .github/workflows/ros-docker-image.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 73f9329..92f1711 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -7,6 +7,8 @@ on: panther_codebase_version: description: Version of the panther_ros to be used in the docker image (branch/tag/commit). required: true + type: string + default: ros2-devel build_type: description: Is it a "development" or a "stable" release? required: true From 5030f07d6cd79c0cfeba594099811219724ad55e Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 11:42:48 +0200 Subject: [PATCH 3/4] Parametrize branch name in Dockerfiles --- Dockerfile.hardware | 3 ++- Dockerfile.simulation | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index a16c142..13b05e5 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -1,5 +1,6 @@ ARG ROS_DISTRO=humble ARG BUILD_TEST=OFF +ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core @@ -13,7 +14,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ${BRANCH_NAME} https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 995fe8b..63eab42 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -1,5 +1,6 @@ ARG ROS_DISTRO=humble ARG BUILD_TEST=OFF +ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core @@ -13,7 +14,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ${BRANCH_NAME} https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ From 98cffa282ad36f45221212a9730e12fdde9ffe7c Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 12:21:10 +0200 Subject: [PATCH 4/4] Change dockerfile args scope --- Dockerfile.hardware | 5 +++-- Dockerfile.simulation | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 13b05e5..198b39f 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -1,9 +1,10 @@ ARG ROS_DISTRO=humble -ARG BUILD_TEST=OFF -ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core +ARG BRANCH_NAME=ros2-devel +ARG BUILD_TEST=OFF + ENV HUSARION_ROS_BUILD_TYPE=hardware STOPSIGNAL SIGINT diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 63eab42..222c5cc 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -1,9 +1,10 @@ ARG ROS_DISTRO=humble -ARG BUILD_TEST=OFF -ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core +ARG BRANCH_NAME=ros2-devel +ARG BUILD_TEST=OFF + ENV HUSARION_ROS_BUILD_TYPE=simulation STOPSIGNAL SIGINT