Skip to content

Commit

Permalink
Merge pull request allenh1#12 from tiiuae/fog_ros_baseimage_update_ha…
Browse files Browse the repository at this point in the history
…ndler

Handle update of fog-ros-baseimage
  • Loading branch information
maseabunikie authored May 2, 2022
2 parents 8efc435 + 4d18df1 commit b3fd57a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build

on:
repository_dispatch:
types: [fog-ros-baseimage-update]
push:

jobs:
Expand All @@ -11,6 +13,19 @@ jobs:

- uses: docker/setup-buildx-action@v1

- name: Set image tag format without suffix
run: |
echo "IMAGE_TAG_FORMAT=type=sha" >> $GITHUB_ENV
if: github.event_name == 'push'

- name: Set image tag format with suffix
# it is possible that run_number should be used instead run_attempt
# run_attempt is unique number on every run and run_attempt resets to 1 if re-build is not used
# content of image_sha_tag_suffix is defined in fog-ros-baseimage dispatcher workflow.
run: |
echo "IMAGE_TAG_FORMAT=type=sha,suffix=-${{ github.event.client_payload.image_sha_tag_suffix }}" >> $GITHUB_ENV
if: github.event_name == 'repository_dispatch'

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
Expand All @@ -19,8 +34,8 @@ jobs:
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
type=raw,value=latest
${{ env.IMAGE_TAG_FORMAT }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ COPY . /main_ws/src/

# this:
# 1) builds the application
# 2) packages the application as .deb & writes it to build_output/
RUN /packaging/build-and-package-as-deb.sh -o build_output/
# 2) packages the application as .deb in /main_ws/
RUN /packaging/build.sh

# ▲ runtime ──┐
# └── build ▼
Expand All @@ -16,7 +16,7 @@ ENTRYPOINT /entrypoint.sh

COPY entrypoint.sh /entrypoint.sh

COPY --from=builder /main_ws/src/build_output/ros-*-rplidar-ros2_*_amd64.deb /rplidar.deb
COPY --from=builder /main_ws/ros-*-rplidar-ros2_*_amd64.deb /rplidar.deb

# need update because ROS people have a habit of removing old packages pretty fast
RUN apt update && apt install -y ros-${ROS_DISTRO}-tf2-ros \
Expand Down

0 comments on commit b3fd57a

Please sign in to comment.