fix: updated fstab to not automount devices #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2023 Martin Scheiber, | |
# Control of Networked Systems, University of Klagenfurt, Austria. | |
# | |
# All rights reserved. | |
# | |
# This software is licensed under the terms of the BSD-2-Clause-License with | |
# no commercial use allowed, the full terms of which are made available | |
# in the LICENSE file. No license in patents is granted. | |
# | |
# You can contact the author at <[email protected]>. | |
name: Skiff Container Build | |
on: | |
push: | |
branches: [ "main", "develop" ] | |
paths: | |
- 'common/rootfs_part/coreenv/flightstack/**' | |
- '.github/workflows/build-env-container.yml' | |
jobs: | |
############################################################################## | |
# Filter changed paths | |
# from https://stackoverflow.com/questions/70708306/github-actions-run-step-job-in-a-workflow-if-changes-happen-in-specific-folde?rq=1 | |
paths-filter: | |
name: Changed File Filter | |
runs-on: ubuntu-latest | |
outputs: | |
base: ${{ steps.filter.outputs.base }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# check if any relevant files for base image have changed (otherwise no need to recompile base) | |
- name: Check Base Change | |
uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
base: | |
- '.github/workflows/build-env-container.yml' | |
- 'common/rootfs_part/coreenv/flightstack/Dockerfile.base' | |
- 'common/rootfs_part/coreenv/flightstack/etc/**' | |
- 'common/rootfs_part/coreenv/flightstack/home/**' | |
- 'common/rootfs_part/coreenv/flightstack/init_scripts/**' | |
############################################################################## | |
# Build Latest Containers | |
build_container_latest: | |
name: Build Flightstack Container (main - ${{ matrix.UNIX_SHORT }}_${{ matrix.ROS_DISTRO }}) | |
needs: paths-filter | |
if: ${{ github.ref_name == 'main' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ROS_DISTRO: [noetic, melodic] | |
UNIX_BASE: | |
- ubuntu:bionic | |
- ubuntu:focal | |
include: | |
- UNIX_BASE: ubuntu:bionic | |
UNIX_SHORT: ubionic | |
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" | |
- UNIX_BASE: ubuntu:focal | |
UNIX_SHORT: ufocal | |
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" | |
exclude: | |
- UNIX_BASE: ubuntu:bionic | |
ROS_DISTRO: noetic | |
- UNIX_BASE: ubuntu:focal | |
ROS_DISTRO: melodic | |
env: | |
# IMAGE_URL: ${{ secrets.GITLAB_REGISTRY_IMAGE_URL }} | |
# IMAGE_NAME: flight_stack | |
IMAGE_URL: ${{ secrets.DOCKERHUB_REGISTRY_USER }} | |
IMAGE_NAME: flightstack | |
COMMIT_HASH: ${{ github.sha }} | |
LATEST_ROS: noetic | |
LATEST_UNIX: ubuntu:focal | |
GIT_VERSION: 1.0.0-rc1 | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "date=$(date '+%F-%H-%M-%S')" >> $GITHUB_OUTPUT | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_REGISTRY_USER}} | |
password: ${{secrets.DOCKERHUB_REGISTRY_PASSWORD}} | |
# registry: ${{secrets.GITLAB_REGISTRY_URL}} | |
######################## | |
### BUILD LATEST IMAGES | |
- name: Build Base Image (latest) | |
if: ${{ matrix.ROS_DISTRO == env.LATEST_ROS && matrix.UNIX_BASE == env.LATEST_UNIX && needs.paths-filter.outputs.base == 'true' }} | |
env: | |
BUILD_TIMESTAMP: ${{ steps.date.outputs.date }} | |
run: > | |
docker buildx build \ | |
--platform=${{ matrix.PLATFORMS }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}-base:latest \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}-base:${COMMIT_HASH::7} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}-base:${{ matrix.UNIX_SHORT }}_${{ matrix.ROS_DISTRO }} \ | |
--build-arg VERSION="${GIT_VERSION}" \ | |
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \ | |
--build-arg ROS_BUILD_DISTRO="${{ matrix.ROS_DISTRO }}" \ | |
--build-arg UNIX_BASE="${{ matrix.UNIX_BASE }}" \ | |
--compress --force-rm --push \ | |
-f ./common/rootfs_part/coreenv/flightstack/Dockerfile.base \ | |
./common/rootfs_part/coreenv/flightstack/ | |
- name: Build Skiff Image (latest) | |
if: ${{ matrix.ROS_DISTRO == env.LATEST_ROS && matrix.UNIX_BASE == env.LATEST_UNIX }} | |
env: | |
BUILD_TIMESTAMP: ${{ steps.date.outputs.date }} | |
run: > | |
docker buildx build \ | |
--platform=${{ matrix.PLATFORMS }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}:latest \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}:${COMMIT_HASH::7} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}:${{ matrix.UNIX_SHORT }}_${{ matrix.ROS_DISTRO }} \ | |
--build-arg BASE_REGISTRY="${IMAGE_URL}/${IMAGE_NAME}-base" \ | |
--build-arg BASE_TAG="latest" \ | |
--build-arg VERSION="${GIT_VERSION}" \ | |
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \ | |
--compress --force-rm --push \ | |
-f ./common/rootfs_part/coreenv/flightstack/Dockerfile \ | |
./common/rootfs_part/coreenv/flightstack/ | |
######################## | |
### BUILD OTHER IMAGES | |
- name: Build Base Image (${{ matrix.UNIX_BASE }} with ROS-${{ matrix.ROS_DISTRO }}) | |
if: ${{ (matrix.ROS_DISTRO != env.LATEST_ROS || matrix.UNIX_BASE != env.LATEST_UNIX) && needs.paths-filter.outputs.base == 'true' }} | |
env: | |
BUILD_TIMESTAMP: ${{ steps.date.outputs.date }} | |
run: > | |
docker buildx build \ | |
--platform=${{ matrix.PLATFORMS }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}-base:${{ matrix.UNIX_SHORT }}_${{ matrix.ROS_DISTRO }} \ | |
--build-arg VERSION="${GIT_VERSION}" \ | |
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \ | |
--build-arg ROS_BUILD_DISTRO="${{ matrix.ROS_DISTRO }}" \ | |
--build-arg UNIX_BASE="${{ matrix.UNIX_BASE }}" \ | |
--compress --force-rm --push \ | |
-f ./common/rootfs_part/coreenv/flightstack/Dockerfile.base \ | |
./common/rootfs_part/coreenv/flightstack/ | |
- name: Build Skiff Image (${{ matrix.UNIX_BASE }} with ROS-${{ matrix.ROS_DISTRO }}) | |
if: ${{ matrix.ROS_DISTRO != env.LATEST_ROS || matrix.UNIX_BASE != env.LATEST_UNIX }} | |
env: | |
BUILD_TIMESTAMP: ${{ steps.date.outputs.date }} | |
run: > | |
docker buildx build \ | |
--platform=${{ matrix.PLATFORMS }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}:${{ matrix.UNIX_SHORT }}_${{ matrix.ROS_DISTRO }} \ | |
--build-arg BASE_REGISTRY="${IMAGE_URL}/${IMAGE_NAME}-base" \ | |
--build-arg BASE_TAG="${{ matrix.UNIX_SHORT }}_${{ matrix.ROS_DISTRO }}" \ | |
--build-arg VERSION="${GIT_VERSION}" \ | |
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \ | |
--compress --force-rm --push \ | |
-f ./common/rootfs_part/coreenv/flightstack/Dockerfile \ | |
./common/rootfs_part/coreenv/flightstack/ | |
############################################################################## | |
# Build Ddv Containers | |
build_container_dev: | |
name: Build Flightstack Dev Container (${{ github.ref_name }}) | |
needs: paths-filter | |
if: ${{ github.ref_name != 'main' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
UNIX_BASE: | |
- ubuntu:focal | |
include: | |
- UNIX_BASE: ubuntu:focal | |
UNIX_SHORT: dev | |
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" | |
env: | |
# IMAGE_URL: ${{ secrets.GITLAB_REGISTRY_IMAGE_URL }} | |
# IMAGE_NAME: flight_stack | |
IMAGE_URL: ${{ secrets.DOCKERHUB_REGISTRY_USER }} | |
IMAGE_NAME: flightstack | |
COMMIT_HASH: ${{ github.sha }} | |
ROS_DISTRO: noetic | |
UNIX_BASE: ubuntu:focal | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "date=$(date '+%F-%H-%M-%S')" >> $GITHUB_OUTPUT | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/[email protected] | |
- name: Login to Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_REGISTRY_USER}} | |
password: ${{secrets.DOCKERHUB_REGISTRY_PASSWORD}} | |
# registry: ${{secrets.GITLAB_REGISTRY_URL}} | |
- name: Build Base Image (${{ matrix.UNIX_SHORT }}) | |
if : ${{ needs.paths-filter.outputs.base == 'true' }} | |
env: | |
BUILD_TIMESTAMP: ${{ steps.date.outputs.date }} | |
run: > | |
docker buildx build \ | |
--platform=${{ matrix.PLATFORMS }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}-base:${{ matrix.UNIX_SHORT }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}-base:${COMMIT_HASH::7} \ | |
--build-arg VERSION="${COMMIT_HASH::7}" \ | |
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \ | |
--build-arg ROS_BUILD_DISTRO="${ROS_DISTRO}" \ | |
--build-arg UNIX_BASE="${{ matrix.UNIX_BASE }}" \ | |
--compress --force-rm --push \ | |
-f ./common/rootfs_part/coreenv/flightstack/Dockerfile.base \ | |
./common/rootfs_part/coreenv/flightstack/ | |
- name: Build Skiff Image (${{ matrix.UNIX_SHORT }}) | |
env: | |
BUILD_TIMESTAMP: ${{ steps.date.outputs.date }} | |
run: > | |
docker buildx build \ | |
--platform=${{ matrix.PLATFORMS }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}:${{ matrix.UNIX_SHORT }} \ | |
--tag ${IMAGE_URL}/${IMAGE_NAME}:${COMMIT_HASH::6} \ | |
--build-arg BASE_REGISTRY="${IMAGE_URL}/${IMAGE_NAME}-base" \ | |
--build-arg BASE_TAG="${{ matrix.UNIX_SHORT }}" \ | |
--build-arg VERSION="${COMMIT_HASH::6}" \ | |
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \ | |
--compress --force-rm --push \ | |
-f ./common/rootfs_part/coreenv/flightstack/Dockerfile \ | |
./common/rootfs_part/coreenv/flightstack/ |