From 8584aa553be83a8c6ef35f31866b74b2c225a022 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 12:09:03 -0500 Subject: [PATCH 01/52] Grab bag of updates - Unique metadata for each image - Security notice in shell welcome message - Added gcc-multilib - Fixed reportgenerator installation shell conditional --- .github/workflows/dev.yml | 53 ++++++++++++++----- .github/workflows/release.yml | 49 ++++++++++++----- README.md | 8 +-- build.sh | 2 +- .../assets/shell/welcome | 13 +++-- build/arm-none-eabi-plugins/docker/Dockerfile | 12 +++-- build/arm-none-eabi/assets/shell/welcome | 13 +++-- build/arm-none-eabi/docker/Dockerfile | 8 ++- build/base/templates/Dockerfile.erb | 8 ++- build/base/templates/welcome.erb | 13 +++-- build/plugins/Dockerfile-build | 2 +- build/plugins/Dockerfile-user | 2 +- build/plugins/assets/shell/welcome | 15 +++--- build/plugins/docker/Dockerfile | 13 +++-- build/standard/assets/shell/welcome | 15 +++--- build/standard/contents.yml | 2 +- build/standard/docker/Dockerfile | 9 +++- build/standard/packages.yml | 1 + 18 files changed, 163 insertions(+), 75 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 873d701..bd949f1 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -10,7 +10,8 @@ on: - 'main' env: - IMAGE_BASE_NAME: 'throwtheswitch/madsciencelab' + IMAGE_ORG: 'throwtheswitch' + IMAGE_BASE_NAME: 'madsciencelab' jobs: @@ -24,6 +25,10 @@ jobs: packages: write attestations: write id-token: write + env: + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" steps: - name: 'Checkout GitHub Action' @@ -49,8 +54,10 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/standard/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} - tags: ${{ env.IMAGE_BASE_NAME }}:latest + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_URL }}:latest madsciencelab-plugins: runs-on: ubuntu-latest @@ -59,8 +66,12 @@ jobs: packages: write attestations: write id-token: write - env: - VARIANT: plugins + env: + VARIANT: 'plugins' + # Cannot reference VARIANT as it does not exist yet + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-plugins" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" steps: - name: 'Checkout GitHub Action' @@ -80,13 +91,15 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker image: madsciencelab-plugins - - name: 'Build Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}' + - name: 'Build Docker image ${{ env.IMAGE_NAME }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 file: build/${{ env.VARIANT }}/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} - tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_URL }}:latest madsciencelab-arm-none-eabi: runs-on: ubuntu-latest @@ -96,7 +109,11 @@ jobs: attestations: write id-token: write env: - VARIANT: arm-none-eabi + VARIANT: 'arm-none-eabi' + # Cannot reference VARIANT as it does not exist yet + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" steps: - name: 'Checkout GitHub Action' @@ -121,8 +138,10 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/${{ env.VARIANT }}/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} - tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_URL }}:latest madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest @@ -132,7 +151,11 @@ jobs: attestations: write id-token: write env: - VARIANT: arm-none-eabi-plugins + VARIANT: 'arm-none-eabi-plugins' + # Cannot reference VARIANT as it does not exist yet + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" steps: - name: 'Checkout GitHub Action' @@ -157,6 +180,8 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/${{ env.VARIANT }}/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} - tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_URL }}:latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac2315d..af4259c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,8 @@ on: - '*' env: - IMAGE_BASE_NAME: 'throwtheswitch/madsciencelab' + IMAGE_ORG: 'throwtheswitch' + IMAGE_BASE_NAME: 'madsciencelab' jobs: @@ -21,6 +22,10 @@ jobs: packages: write attestations: write id-token: write + env: + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" steps: - name: 'Checkout GitHub Action' @@ -46,9 +51,11 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/standard/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}:latest + tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest madsciencelab-plugins: runs-on: ubuntu-latest @@ -58,7 +65,11 @@ jobs: attestations: write id-token: write env: - VARIANT: plugins + VARIANT: 'plugins' + # Cannot reference VARIANT as it does not exist yet + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-plugins" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" steps: - name: 'Checkout GitHub Action' @@ -83,9 +94,11 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/${{ env.VARIANT }}/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest + tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest madsciencelab-arm-none-eabi: runs-on: ubuntu-latest @@ -95,7 +108,11 @@ jobs: attestations: write id-token: write env: - VARIANT: arm-none-eabi + VARIANT: 'arm-none-eabi' + # Cannot reference VARIANT as it does not exist yet + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" steps: - name: 'Checkout GitHub Action' @@ -120,9 +137,11 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/${{ env.VARIANT }}/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest + tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest @@ -132,7 +151,11 @@ jobs: attestations: write id-token: write env: - VARIANT: arm-none-eabi-plugins + VARIANT: 'arm-none-eabi-plugins' + # Cannot reference VARIANT as it does not exist yet + IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" steps: - name: 'Checkout GitHub Action' @@ -157,7 +180,9 @@ jobs: with: platforms: linux/amd64,linux/arm64 file: build/${{ env.VARIANT }}/docker/Dockerfile - build-args: CONTAINER_VERSION=${{ github.ref_name }} + build-args: | + CONTAINER_VERSION=${{ github.ref_name }} + IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest + tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest diff --git a/README.md b/README.md index abc1551..d87f5a8 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ image is to create an easy-to-install portable system for running unit tests wit ### Generating Dockerfiles -`./build.sh --dir build/standard --variant "" --version 1.0.0-prerelease` +`./build.sh --dir build/standard --variant "" --version 1.0.0` -`./build.sh --dir build/standard --dir build/plugins --version 1.0.0-prerelease` +`./build.sh --dir build/standard --dir build/plugins --version 1.0.0` -`./build.sh --dir build/arm-none-eabi --version 1.0.0-prerelease` +`./build.sh --dir build/arm-none-eabi --version 1.0.0` -`./build.sh --dir build/arm-none-eabi --dir build/plugins --dir build/arm-none-eabi-plugins --version 1.0.0-prerelease` +`./build.sh --dir build/arm-none-eabi --dir build/plugins --dir build/arm-none-eabi-plugins --version 1.0.0` ## Basic Articles Discussing Unit Testing diff --git a/build.sh b/build.sh index da798a6..7f7f630 100755 --- a/build.sh +++ b/build.sh @@ -298,7 +298,7 @@ if [ "$BUILD" = true ]; then # Perform multi-platform build with output as an image or optionally a direct push to the repository # Always echo this command to the command line - (set -x; docker $BUILD_ACTION $LOG_ARGS -t "$IMAGE":"$IMAGE_TAG" $PLATFORM_ARGS --build-arg CONTAINER_VERSION="$CONTAINER_VERSION" -f "$VARIANT_DIR_PATH"/docker/Dockerfile .) + (set -x; docker $BUILD_ACTION $LOG_ARGS -t "$IMAGE":"$IMAGE_TAG" $PLATFORM_ARGS --build-arg CONTAINER_VERSION="$CONTAINER_VERSION" --build_arg IMAGE_NAME="$IMAGE" -f "$VARIANT_DIR_PATH"/docker/Dockerfile .) # Capture exit code from attempted Docker image build success=$? diff --git a/build/arm-none-eabi-plugins/assets/shell/welcome b/build/arm-none-eabi-plugins/assets/shell/welcome index b7a2a9b..34cb344 100644 --- a/build/arm-none-eabi-plugins/assets/shell/welcome +++ b/build/arm-none-eabi-plugins/assets/shell/welcome @@ -1,6 +1,6 @@ echo "" -echo "\u001b[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \u001b[0m" -echo "\u001b[37m" +echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" +echo "\e[37m" echo " This container includes:" if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi @@ -15,6 +15,9 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * unzip, git & svn for use by if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * tput for use by Beep plugin"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Python 3, needed by gcovr"; fi if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * Dotnet 8, needed by reportgenerator"; fi -echo "" -echo " To get started, enter \`ceedling help\` at the command line." -echo "\u001b[0m" +echo "\e[0m" +echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." +echo " This limits installing software and more. See Docker Hub page for container security docs and options." +echo "\e[33m" +echo " To get started, enter \`ceedling help\` at the command line..." +echo "\e[0m" diff --git a/build/arm-none-eabi-plugins/docker/Dockerfile b/build/arm-none-eabi-plugins/docker/Dockerfile index f1592b9..a169db4 100644 --- a/build/arm-none-eabi-plugins/docker/Dockerfile +++ b/build/arm-none-eabi-plugins/docker/Dockerfile @@ -19,6 +19,10 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` +ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME + # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -28,8 +32,8 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## ## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker -LABEL org.opencontainers.image.url=https://github.com/ThrowTheSwitch/MadScienceLabDocker/blob/master/README.md +LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases +LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" @@ -115,7 +119,7 @@ RUN set -ex \ # Microsoft Dotnet installation to support `reportgenerator` for `gcov` plugin # Only available on AMD64 image builds -RUN if [[ $TARGETPLATFORM == "linux/amd64" ]] ; then set -ex \ +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ && dpkg -i /assets/plugins/dotnet/packages-microsoft-prod.deb \ && apt update \ && apt install -y \ @@ -159,7 +163,7 @@ USER dev # Install `reportgenerator` (for `gcov` plugin) # Only available in AMD64 containers -RUN if [[ $TARGETPLATFORM == "linux/amd64" ]] ; then set -ex \ +RUN if [ "$TARGETPLATFORM" == "linux/amd64" ]; then set -ex \ # Install the dotnet tool as global (which means global for the current user vs. a local directory) && dotnet tool install --global dotnet-reportgenerator-globaltool \ # Modify the PATH so the new tool is findable diff --git a/build/arm-none-eabi/assets/shell/welcome b/build/arm-none-eabi/assets/shell/welcome index ee33042..55b0540 100644 --- a/build/arm-none-eabi/assets/shell/welcome +++ b/build/arm-none-eabi/assets/shell/welcome @@ -1,6 +1,6 @@ echo "" -echo "\u001b[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \u001b[0m" -echo "\u001b[37m" +echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" +echo "\e[37m" echo " This container includes:" if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi @@ -9,6 +9,9 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * GNU Compiler Collection (gcc, etc.) for ARM"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries (ARM)"; fi -echo "" -echo " To get started, enter \`ceedling help\` at the command line." -echo "\u001b[0m" +echo "\e[0m" +echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." +echo " This limits installing software and more. See Docker Hub page for container security docs and options." +echo "\e[33m" +echo " To get started, enter \`ceedling help\` at the command line..." +echo "\e[0m" diff --git a/build/arm-none-eabi/docker/Dockerfile b/build/arm-none-eabi/docker/Dockerfile index 46b803e..cacc697 100644 --- a/build/arm-none-eabi/docker/Dockerfile +++ b/build/arm-none-eabi/docker/Dockerfile @@ -19,6 +19,10 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` +ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME + # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -28,8 +32,8 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## ## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker -LABEL org.opencontainers.image.url=https://github.com/ThrowTheSwitch/MadScienceLabDocker/blob/master/README.md +LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases +LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" diff --git a/build/base/templates/Dockerfile.erb b/build/base/templates/Dockerfile.erb index a3d6a30..207b587 100644 --- a/build/base/templates/Dockerfile.erb +++ b/build/base/templates/Dockerfile.erb @@ -19,6 +19,10 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` +ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME + # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -28,8 +32,8 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## ## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker -LABEL org.opencontainers.image.url=https://github.com/ThrowTheSwitch/MadScienceLabDocker/blob/master/README.md +LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases +LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" diff --git a/build/base/templates/welcome.erb b/build/base/templates/welcome.erb index ab03956..fefca8b 100644 --- a/build/base/templates/welcome.erb +++ b/build/base/templates/welcome.erb @@ -1,9 +1,12 @@ echo "" -echo "\u001b[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \u001b[0m" -echo "\u001b[37m" +echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" +echo "\e[37m" echo " This container includes:" <%# INSERT CONTENTS LIST -%> <% @contents.each {|item|%><%= "if [[ \"$CONTAINER_PLATFORM\" == #{item['platform']} ]]; then echo \" * #{item['entry']}\"; fi\n"%><% } -%> -echo "" -echo " To get started, enter \`ceedling help\` at the command line." -echo "\u001b[0m" +echo "\e[0m" +echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." +echo " This limits installing software and more. See Docker Hub page for container security docs and options." +echo "\e[33m" +echo " To get started, enter \`ceedling help\` at the command line..." +echo "\e[0m" diff --git a/build/plugins/Dockerfile-build b/build/plugins/Dockerfile-build index 59e9aec..4540def 100644 --- a/build/plugins/Dockerfile-build +++ b/build/plugins/Dockerfile-build @@ -1,7 +1,7 @@ # Microsoft Dotnet installation to support `reportgenerator` for `gcov` plugin # Only available on AMD64 image builds -RUN if [[ $TARGETPLATFORM == "linux/amd64" ]] ; then set -ex \ +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ && dpkg -i /assets/plugins/dotnet/packages-microsoft-prod.deb \ && apt update \ && apt install -y \ diff --git a/build/plugins/Dockerfile-user b/build/plugins/Dockerfile-user index d19f3b0..18f02ef 100644 --- a/build/plugins/Dockerfile-user +++ b/build/plugins/Dockerfile-user @@ -1,7 +1,7 @@ # Install `reportgenerator` (for `gcov` plugin) # Only available in AMD64 containers -RUN if [[ $TARGETPLATFORM == "linux/amd64" ]] ; then set -ex \ +RUN if [ "$TARGETPLATFORM" == "linux/amd64" ]; then set -ex \ # Install the dotnet tool as global (which means global for the current user vs. a local directory) && dotnet tool install --global dotnet-reportgenerator-globaltool \ # Modify the PATH so the new tool is findable diff --git a/build/plugins/assets/shell/welcome b/build/plugins/assets/shell/welcome index cf0389f..c97aea1 100644 --- a/build/plugins/assets/shell/welcome +++ b/build/plugins/assets/shell/welcome @@ -1,6 +1,6 @@ echo "" -echo "\u001b[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \u001b[0m" -echo "\u001b[37m" +echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" +echo "\e[37m" echo " This container includes:" if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi @@ -8,7 +8,7 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Compiler Collection (gcc, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries"; fi +if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries and multilib support"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Debugger (gdb) for Ceedling's backtrace feature"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * gcovr for use by GCov plugin"; fi if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * reportgenerator for use by GCov plugin"; fi @@ -16,6 +16,9 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * unzip, git & svn for use by if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * tput for use by Beep plugin"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Python 3, needed by gcovr"; fi if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * Dotnet 8, needed by reportgenerator"; fi -echo "" -echo " To get started, enter \`ceedling help\` at the command line." -echo "\u001b[0m" +echo "\e[0m" +echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." +echo " This limits installing software and more. See Docker Hub page for container security docs and options." +echo "\e[33m" +echo " To get started, enter \`ceedling help\` at the command line..." +echo "\e[0m" diff --git a/build/plugins/docker/Dockerfile b/build/plugins/docker/Dockerfile index ab4d7b8..e5891b1 100644 --- a/build/plugins/docker/Dockerfile +++ b/build/plugins/docker/Dockerfile @@ -19,6 +19,10 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` +ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME + # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -28,8 +32,8 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## ## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker -LABEL org.opencontainers.image.url=https://github.com/ThrowTheSwitch/MadScienceLabDocker/blob/master/README.md +LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases +LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" @@ -43,6 +47,7 @@ RUN set -ex \ build-essential \ coreutils \ gcc \ + gcc-multlib \ gcovr \ gdb \ git-all \ @@ -116,7 +121,7 @@ RUN set -ex \ # Microsoft Dotnet installation to support `reportgenerator` for `gcov` plugin # Only available on AMD64 image builds -RUN if [[ $TARGETPLATFORM == "linux/amd64" ]] ; then set -ex \ +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ && dpkg -i /assets/plugins/dotnet/packages-microsoft-prod.deb \ && apt update \ && apt install -y \ @@ -160,7 +165,7 @@ USER dev # Install `reportgenerator` (for `gcov` plugin) # Only available in AMD64 containers -RUN if [[ $TARGETPLATFORM == "linux/amd64" ]] ; then set -ex \ +RUN if [ "$TARGETPLATFORM" == "linux/amd64" ]; then set -ex \ # Install the dotnet tool as global (which means global for the current user vs. a local directory) && dotnet tool install --global dotnet-reportgenerator-globaltool \ # Modify the PATH so the new tool is findable diff --git a/build/standard/assets/shell/welcome b/build/standard/assets/shell/welcome index 4fb4fef..f575468 100644 --- a/build/standard/assets/shell/welcome +++ b/build/standard/assets/shell/welcome @@ -1,6 +1,6 @@ echo "" -echo "\u001b[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \u001b[0m" -echo "\u001b[37m" +echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" +echo "\e[37m" echo " This container includes:" if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi @@ -8,8 +8,11 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Compiler Collection (gcc, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries"; fi +if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries and multilib support"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Debugger (gdb) for Ceedling's backtrace feature"; fi -echo "" -echo " To get started, enter \`ceedling help\` at the command line." -echo "\u001b[0m" +echo "\e[0m" +echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." +echo " This limits installing software and more. See Docker Hub page for container security docs and options." +echo "\e[33m" +echo " To get started, enter \`ceedling help\` at the command line..." +echo "\e[0m" diff --git a/build/standard/contents.yml b/build/standard/contents.yml index c8d6d01..ed46d60 100644 --- a/build/standard/contents.yml +++ b/build/standard/contents.yml @@ -1,4 +1,4 @@ # Ruby symbols not allowed as keys in inline YML - {platform: '*', entry: 'The GNU Compiler Collection (gcc, etc.)'} -- {platform: '*', entry: 'Standard C libraries'} +- {platform: '*', entry: 'Standard C libraries and multilib support'} - {platform: '*', entry: "The GNU Debugger (gdb) for Ceedling's backtrace feature"} diff --git a/build/standard/docker/Dockerfile b/build/standard/docker/Dockerfile index 28e8d79..87ca605 100644 --- a/build/standard/docker/Dockerfile +++ b/build/standard/docker/Dockerfile @@ -19,6 +19,10 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` +ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME + # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -28,8 +32,8 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## ## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker -LABEL org.opencontainers.image.url=https://github.com/ThrowTheSwitch/MadScienceLabDocker/blob/master/README.md +LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases +LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" @@ -43,6 +47,7 @@ RUN set -ex \ build-essential \ coreutils \ gcc \ + gcc-multlib \ gdb \ libc-dev \ locales \ diff --git a/build/standard/packages.yml b/build/standard/packages.yml index cd11a0b..a4d3ea5 100644 --- a/build/standard/packages.yml +++ b/build/standard/packages.yml @@ -1,4 +1,5 @@ - gcc # GNU Compiler Collection - libc-dev # Common C development packages +- gcc-multlib # Processor architectures - gdb # Debugger (for Ceedling `backtrace` feature) From 40d270b9042996c3f4e68b01e2c5cdde3af3d824 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 13:35:15 -0500 Subject: [PATCH 02/52] =?UTF-8?q?=F0=9F=92=9A=20Github=20Action=20fix=20at?= =?UTF-8?q?tempts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index bd949f1..e99cab2 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -26,9 +26,8 @@ jobs: attestations: write id-token: write env: - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}" - # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" + IMAGE_NAME: "$IMAGE_BASE_NAME" + IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-plugins" steps: - name: 'Checkout GitHub Action' @@ -69,9 +68,9 @@ jobs: env: VARIANT: 'plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-plugins" + IMAGE_NAME: "$IMAGE_BASE_NAME-plugins" # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" + IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-plugins" steps: - name: 'Checkout GitHub Action' @@ -111,9 +110,9 @@ jobs: env: VARIANT: 'arm-none-eabi' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" + IMAGE_NAME: "$IMAGE_BASE_NAME-arm-none-eabi" # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" + IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-arm-none-eabi" steps: - name: 'Checkout GitHub Action' @@ -153,9 +152,9 @@ jobs: env: VARIANT: 'arm-none-eabi-plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" + IMAGE_NAME: "$IMAGE_BASE_NAME-arm-none-eabi-plugins" # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" + IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-arm-none-eabi-plugins" steps: - name: 'Checkout GitHub Action' From 96ea11861543af8ac4da3ba99bc3d114cc4cc806 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 21:31:19 -0500 Subject: [PATCH 03/52] =?UTF-8?q?=F0=9F=92=9A=20More=20Github=20Action=20f?= =?UTF-8?q?ixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index e99cab2..53a3024 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: push: branches: - - '*' + - * pull_request: branches: - - 'main' + - main env: IMAGE_ORG: 'throwtheswitch' @@ -18,16 +18,24 @@ jobs: # Jobs organized for concurrent Docker image builds # Jobs only build :latest images without pushing to Docker Hub + # This is a self-documenting workaround to the limitation that the global `env:` context is not available to jobs' `env:` contexts + prepare-env-vars: + runs-on: ubuntu-latest + steps: + # A step must be present in order to make use of `outputs:` + - run: echo "Setting environment variables shared by jobs..." + outputs: + IMAGE_BASE_NAME: ${{ env.IMAGE_BASE_NAME }} + IMAGE_URL_BASE: ${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }} + madsciencelab: runs-on: ubuntu-latest + needs: [prepare-env-vars] permissions: contents: read packages: write attestations: write id-token: write - env: - IMAGE_NAME: "$IMAGE_BASE_NAME" - IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-plugins" steps: - name: 'Checkout GitHub Action' @@ -55,11 +63,12 @@ jobs: file: build/standard/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} - IMAGE_NAME=${{ env.IMAGE_NAME }} - tags: ${{ env.IMAGE_URL }}:latest + IMAGE_NAME=${{ env.IMAGE_BASE_NAME }} + tags: ${{ env.IMAGE_URL_BASE }}:latest madsciencelab-plugins: runs-on: ubuntu-latest + needs: [prepare-env-vars] permissions: contents: read packages: write @@ -68,9 +77,9 @@ jobs: env: VARIANT: 'plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "$IMAGE_BASE_NAME-plugins" + IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}-plugins # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-plugins" + IMAGE_URL: ${{ env.IMAGE_URL_BASE }}-plugins steps: - name: 'Checkout GitHub Action' @@ -102,6 +111,7 @@ jobs: madsciencelab-arm-none-eabi: runs-on: ubuntu-latest + needs: [prepare-env-vars] permissions: contents: read packages: write @@ -110,9 +120,9 @@ jobs: env: VARIANT: 'arm-none-eabi' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "$IMAGE_BASE_NAME-arm-none-eabi" + IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}-arm-none-eabi # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-arm-none-eabi" + IMAGE_URL: ${{ env.IMAGE_URL_BASE }}-arm-none-eabi steps: - name: 'Checkout GitHub Action' @@ -144,6 +154,7 @@ jobs: madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest + needs: [prepare-env-vars] permissions: contents: read packages: write @@ -152,9 +163,9 @@ jobs: env: VARIANT: 'arm-none-eabi-plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "$IMAGE_BASE_NAME-arm-none-eabi-plugins" + IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "$IMAGE_ORG/$IMAGE_BASE_NAME-arm-none-eabi-plugins" + IMAGE_URL: ${{ env.IMAGE_URL_BASE }}-arm-none-eabi-plugins steps: - name: 'Checkout GitHub Action' From 86841a752a26845b73bdee40d05c6882076641c8 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 21:32:30 -0500 Subject: [PATCH 04/52] =?UTF-8?q?=F0=9F=92=9A=20Github=20Action=20YAML=20s?= =?UTF-8?q?yntax=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 53a3024..ae576b0 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: push: branches: - - * + - "*" pull_request: branches: - - main + - "main" env: IMAGE_ORG: 'throwtheswitch' From 462c9e8b321886838d1f87fd0b53f4835715d0c1 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 21:55:32 -0500 Subject: [PATCH 05/52] =?UTF-8?q?=F0=9F=92=9A=20Another=20Github=20Action?= =?UTF-8?q?=20fix=20attempt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 44 +++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index ae576b0..ed7183e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -18,24 +18,28 @@ jobs: # Jobs organized for concurrent Docker image builds # Jobs only build :latest images without pushing to Docker Hub - # This is a self-documenting workaround to the limitation that the global `env:` context is not available to jobs' `env:` contexts - prepare-env-vars: + # This is a workaround to the limitation that an `env:` map cannot reference the `env:` map to create additional environment variables + image-details: runs-on: ubuntu-latest steps: # A step must be present in order to make use of `outputs:` - - run: echo "Setting environment variables shared by jobs..." + - run: echo "Setting Docker image details..." outputs: - IMAGE_BASE_NAME: ${{ env.IMAGE_BASE_NAME }} - IMAGE_URL_BASE: ${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }} + base-name: 'madsciencelab' + base-url: 'throwtheswitch/madsciencelab' madsciencelab: runs-on: ubuntu-latest - needs: [prepare-env-vars] + needs: [image-details] permissions: contents: read packages: write attestations: write id-token: write + env: + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }} + # Cannot reference IMAGE_NAME as it does not exist yet + IMAGE_URL: ${{ needs.image-details.outputs.base-url }} steps: - name: 'Checkout GitHub Action' @@ -56,19 +60,19 @@ jobs: # Docker image: madsciencelab # Note: standard/ directory maps to madsciencelab image (no variants) - - name: 'Build Docker image ${{ env.IMAGE_BASE_NAME }}' + - name: 'Build Docker image ${{ env.IMAGE_NAME }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 file: build/standard/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} - IMAGE_NAME=${{ env.IMAGE_BASE_NAME }} - tags: ${{ env.IMAGE_URL_BASE }}:latest + IMAGE_NAME=${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_URL }}:latest madsciencelab-plugins: runs-on: ubuntu-latest - needs: [prepare-env-vars] + needs: [image-details] permissions: contents: read packages: write @@ -77,9 +81,9 @@ jobs: env: VARIANT: 'plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}-plugins + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-plugins # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: ${{ env.IMAGE_URL_BASE }}-plugins + IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-plugins steps: - name: 'Checkout GitHub Action' @@ -111,7 +115,7 @@ jobs: madsciencelab-arm-none-eabi: runs-on: ubuntu-latest - needs: [prepare-env-vars] + needs: [image-details] permissions: contents: read packages: write @@ -120,9 +124,9 @@ jobs: env: VARIANT: 'arm-none-eabi' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}-arm-none-eabi + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: ${{ env.IMAGE_URL_BASE }}-arm-none-eabi + IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi steps: - name: 'Checkout GitHub Action' @@ -142,7 +146,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker image: madsciencelab-arm-none-eabi - - name: 'Build Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}' + - name: 'Build Docker image ${{ env.IMAGE_NAME }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 @@ -154,7 +158,7 @@ jobs: madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest - needs: [prepare-env-vars] + needs: [image-details] permissions: contents: read packages: write @@ -163,9 +167,9 @@ jobs: env: VARIANT: 'arm-none-eabi-plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi-plugins # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: ${{ env.IMAGE_URL_BASE }}-arm-none-eabi-plugins + IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins steps: - name: 'Checkout GitHub Action' @@ -185,7 +189,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker image: madsciencelab-arm-none-eabi-plugins - - name: 'Build Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}' + - name: 'Build Docker image ${{ env.IMAGE_NAME }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 From b517bca66a50366f2f30f314e53b3fe0666ad61e Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 21:59:44 -0500 Subject: [PATCH 06/52] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20package=20name=20t?= =?UTF-8?q?ypo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/docker/Dockerfile | 2 +- build/standard/docker/Dockerfile | 2 +- build/standard/packages.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/plugins/docker/Dockerfile b/build/plugins/docker/Dockerfile index e5891b1..3d9f313 100644 --- a/build/plugins/docker/Dockerfile +++ b/build/plugins/docker/Dockerfile @@ -47,7 +47,7 @@ RUN set -ex \ build-essential \ coreutils \ gcc \ - gcc-multlib \ + gcc-multilib \ gcovr \ gdb \ git-all \ diff --git a/build/standard/docker/Dockerfile b/build/standard/docker/Dockerfile index 87ca605..0e66917 100644 --- a/build/standard/docker/Dockerfile +++ b/build/standard/docker/Dockerfile @@ -47,7 +47,7 @@ RUN set -ex \ build-essential \ coreutils \ gcc \ - gcc-multlib \ + gcc-multilib \ gdb \ libc-dev \ locales \ diff --git a/build/standard/packages.yml b/build/standard/packages.yml index a4d3ea5..cf6f3a6 100644 --- a/build/standard/packages.yml +++ b/build/standard/packages.yml @@ -1,5 +1,5 @@ - gcc # GNU Compiler Collection - libc-dev # Common C development packages -- gcc-multlib # Processor architectures +- gcc-multilib # Processor architectures - gdb # Debugger (for Ceedling `backtrace` feature) From eaa70902bdc06c629c8804b1816f0c66e2f17964 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 22:15:55 -0500 Subject: [PATCH 07/52] =?UTF-8?q?=F0=9F=90=9B=20gcc-multilib=20only=20avai?= =?UTF-8?q?lable=20for=20amd64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/docker/Dockerfile | 10 +++++++++- build/standard/Dockerfile-build | 9 +++++++++ build/standard/docker/Dockerfile | 10 +++++++++- build/standard/packages.yml | 1 - 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 build/standard/Dockerfile-build diff --git a/build/plugins/docker/Dockerfile b/build/plugins/docker/Dockerfile index 3d9f313..a375045 100644 --- a/build/plugins/docker/Dockerfile +++ b/build/plugins/docker/Dockerfile @@ -47,7 +47,6 @@ RUN set -ex \ build-essential \ coreutils \ gcc \ - gcc-multilib \ gcovr \ gdb \ git-all \ @@ -119,6 +118,15 @@ RUN set -ex \ && bundle install --gemfile=/assets/base/gems/Gemfile \ && rm .gemrc +# gcc-multilib for processor architectures is only available for AMD64 image builds +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ + && apt update \ + && apt install -y \ + gcc-multilib \ + --no-install-recommends \ + && apt clean \ + && rm -rf /var/lib/apt/lists/* ; fi + # Microsoft Dotnet installation to support `reportgenerator` for `gcov` plugin # Only available on AMD64 image builds RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ diff --git a/build/standard/Dockerfile-build b/build/standard/Dockerfile-build new file mode 100644 index 0000000..bce6207 --- /dev/null +++ b/build/standard/Dockerfile-build @@ -0,0 +1,9 @@ + +# gcc-multilib for processor architectures is only available for AMD64 image builds +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ + && apt update \ + && apt install -y \ + gcc-multilib \ + --no-install-recommends \ + && apt clean \ + && rm -rf /var/lib/apt/lists/* ; fi diff --git a/build/standard/docker/Dockerfile b/build/standard/docker/Dockerfile index 0e66917..380c2f1 100644 --- a/build/standard/docker/Dockerfile +++ b/build/standard/docker/Dockerfile @@ -47,7 +47,6 @@ RUN set -ex \ build-essential \ coreutils \ gcc \ - gcc-multilib \ gdb \ libc-dev \ locales \ @@ -103,6 +102,15 @@ RUN set -ex \ && bundle install --gemfile=/assets/base/gems/Gemfile \ && rm .gemrc +# gcc-multilib for processor architectures is only available for AMD64 image builds +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ + && apt update \ + && apt install -y \ + gcc-multilib \ + --no-install-recommends \ + && apt clean \ + && rm -rf /var/lib/apt/lists/* ; fi + ## ## Permissions Security & Cleanup diff --git a/build/standard/packages.yml b/build/standard/packages.yml index cf6f3a6..cd11a0b 100644 --- a/build/standard/packages.yml +++ b/build/standard/packages.yml @@ -1,5 +1,4 @@ - gcc # GNU Compiler Collection - libc-dev # Common C development packages -- gcc-multilib # Processor architectures - gdb # Debugger (for Ceedling `backtrace` feature) From d65b2d0c6270314fa6843b79831d01374d553258 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 22 Jan 2025 22:21:43 -0500 Subject: [PATCH 08/52] =?UTF-8?q?=F0=9F=92=9A=20Match=20all=20branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index ed7183e..190668a 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - "*" + - "**" pull_request: branches: - "main" From 8bc97d1959d5fcc12530470550909abfcfd0e57f Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 11:52:46 -0500 Subject: [PATCH 09/52] =?UTF-8?q?=F0=9F=90=9B=20Docker=20build=20argument?= =?UTF-8?q?=20CLI=20argument=20name=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7f7f630..15223bc 100755 --- a/build.sh +++ b/build.sh @@ -298,7 +298,7 @@ if [ "$BUILD" = true ]; then # Perform multi-platform build with output as an image or optionally a direct push to the repository # Always echo this command to the command line - (set -x; docker $BUILD_ACTION $LOG_ARGS -t "$IMAGE":"$IMAGE_TAG" $PLATFORM_ARGS --build-arg CONTAINER_VERSION="$CONTAINER_VERSION" --build_arg IMAGE_NAME="$IMAGE" -f "$VARIANT_DIR_PATH"/docker/Dockerfile .) + (set -x; docker $BUILD_ACTION $LOG_ARGS -t "$IMAGE":"$IMAGE_TAG" $PLATFORM_ARGS --build-arg CONTAINER_VERSION="$CONTAINER_VERSION" --build-arg IMAGE_NAME="$IMAGE" -f "$VARIANT_DIR_PATH"/docker/Dockerfile .) # Capture exit code from attempted Docker image build success=$? From fc3ad69e5b84f75f25bc685b6c988b83bd64acbb Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 11:53:30 -0500 Subject: [PATCH 10/52] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20build=20arguments?= =?UTF-8?q?=20and=20container=20URL=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/base/templates/Dockerfile.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/base/templates/Dockerfile.erb b/build/base/templates/Dockerfile.erb index 207b587..a982cf4 100644 --- a/build/base/templates/Dockerfile.erb +++ b/build/base/templates/Dockerfile.erb @@ -12,6 +12,10 @@ FROM bitnami/minideb:bookworm # recognized platform string (e.g. "linux/amd64"). ARG TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` / +ARG IMAGE_NAME + # This build argument allows setting the image tag at build time to support CI-based builds # The command line must include `--build-arg CONTAINER_VERSION=` ARG CONTAINER_VERSION @@ -19,10 +23,6 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` -ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME - # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -33,7 +33,7 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## Metadata LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME +LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" From 56d001cf4b280ce3d52d1ba9b3e6446160472d85 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 11:54:31 -0500 Subject: [PATCH 11/52] =?UTF-8?q?=F0=9F=90=9B=20Restrict=20welcome=20messa?= =?UTF-8?q?ge=20for=20multilib=20to=20amd64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/standard/contents.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/standard/contents.yml b/build/standard/contents.yml index ed46d60..ec60e89 100644 --- a/build/standard/contents.yml +++ b/build/standard/contents.yml @@ -1,4 +1,5 @@ # Ruby symbols not allowed as keys in inline YML - {platform: '*', entry: 'The GNU Compiler Collection (gcc, etc.)'} -- {platform: '*', entry: 'Standard C libraries and multilib support'} +- {platform: '*', entry: 'Standard C libraries'} +- {platform: 'linux/amd64', entry: 'GCC Multilib support for platform architectures'} - {platform: '*', entry: "The GNU Debugger (gdb) for Ceedling's backtrace feature"} From 495dbe87ffdf85d6fc095cb299fd3858fd759ee0 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 11:57:44 -0500 Subject: [PATCH 12/52] =?UTF-8?q?=F0=9F=91=B7=20Release=20build=20matches?= =?UTF-8?q?=20dev=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 38 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af4259c..98daba6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,17 +15,28 @@ jobs: # Jobs organized for concurrent Docker image builds # Jobs build tagged and :latest images and push to Docker Hub + # This is a workaround to the limitation that an `env:` map cannot reference the `env:` map to create additional environment variables + image-details: + runs-on: ubuntu-latest + steps: + # A step must be present in order to make use of `outputs:` + - run: echo "Setting Docker image details..." + outputs: + base-name: 'madsciencelab' + base-url: 'throwtheswitch/madsciencelab' + madsciencelab: runs-on: ubuntu-latest + needs: [image-details] permissions: contents: read packages: write attestations: write id-token: write env: - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}" + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }} # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" + IMAGE_URL: ${{ needs.image-details.outputs.base-url }} steps: - name: 'Checkout GitHub Action' @@ -46,7 +57,7 @@ jobs: # Docker image: madsciencelab # Note: standard/ directory maps to madsciencelab image (no variants) - - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}' + - name: 'Build and push Docker image ${{ env.IMAGE_NAME }}:${{ github.ref_name }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 @@ -59,6 +70,7 @@ jobs: madsciencelab-plugins: runs-on: ubuntu-latest + needs: [image-details] permissions: contents: read packages: write @@ -67,9 +79,9 @@ jobs: env: VARIANT: 'plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-plugins" + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-plugins # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-plugins" + IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-plugins steps: - name: 'Checkout GitHub Action' @@ -89,7 +101,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker image: madsciencelab-plugins - - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' + - name: 'Build and push Docker image ${{ env.IMAGE_NAME }}:${{ github.ref_name }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 @@ -102,6 +114,7 @@ jobs: madsciencelab-arm-none-eabi: runs-on: ubuntu-latest + needs: [image-details] permissions: contents: read packages: write @@ -110,9 +123,9 @@ jobs: env: VARIANT: 'arm-none-eabi' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi" + IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi steps: - name: 'Checkout GitHub Action' @@ -132,7 +145,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker image: madsciencelab-arm-none-eabi - - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' + - name: 'Build and push Docker image ${{ env.IMAGE_NAME }}:${{ github.ref_name }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 @@ -145,6 +158,7 @@ jobs: madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest + needs: [image-details] permissions: contents: read packages: write @@ -153,9 +167,9 @@ jobs: env: VARIANT: 'arm-none-eabi-plugins' # Cannot reference VARIANT as it does not exist yet - IMAGE_NAME: "${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" + IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi-plugins # Cannot reference IMAGE_NAME as it does not exist yet - IMAGE_URL: "${{ env.IMAGE_ORG }}/${{ env.IMAGE_BASE_NAME }}-arm-none-eabi-plugins" + IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins steps: - name: 'Checkout GitHub Action' @@ -175,7 +189,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker image: madsciencelab-arm-none-eabi-plugins - - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' + - name: 'Build and push Docker image ${{ env.IMAGE_NAME }}:${{ github.ref_name }}' uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 From 7cdef7ab829e4651c2d19b104dfa7f105d6480ac Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 12:00:49 -0500 Subject: [PATCH 13/52] =?UTF-8?q?=F0=9F=90=9B=20Regenerated=20files=20afte?= =?UTF-8?q?r=20content=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/arm-none-eabi-plugins/docker/Dockerfile | 10 +++++----- build/arm-none-eabi/docker/Dockerfile | 10 +++++----- build/plugins/assets/shell/welcome | 3 ++- build/plugins/docker/Dockerfile | 10 +++++----- build/standard/assets/shell/welcome | 3 ++- build/standard/docker/Dockerfile | 10 +++++----- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/build/arm-none-eabi-plugins/docker/Dockerfile b/build/arm-none-eabi-plugins/docker/Dockerfile index a169db4..f99d4ea 100644 --- a/build/arm-none-eabi-plugins/docker/Dockerfile +++ b/build/arm-none-eabi-plugins/docker/Dockerfile @@ -12,6 +12,10 @@ FROM bitnami/minideb:bookworm # recognized platform string (e.g. "linux/amd64"). ARG TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` / +ARG IMAGE_NAME + # This build argument allows setting the image tag at build time to support CI-based builds # The command line must include `--build-arg CONTAINER_VERSION=` ARG CONTAINER_VERSION @@ -19,10 +23,6 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` -ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME - # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -33,7 +33,7 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## Metadata LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME +LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" diff --git a/build/arm-none-eabi/docker/Dockerfile b/build/arm-none-eabi/docker/Dockerfile index cacc697..03f41e9 100644 --- a/build/arm-none-eabi/docker/Dockerfile +++ b/build/arm-none-eabi/docker/Dockerfile @@ -12,6 +12,10 @@ FROM bitnami/minideb:bookworm # recognized platform string (e.g. "linux/amd64"). ARG TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` / +ARG IMAGE_NAME + # This build argument allows setting the image tag at build time to support CI-based builds # The command line must include `--build-arg CONTAINER_VERSION=` ARG CONTAINER_VERSION @@ -19,10 +23,6 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` -ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME - # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -33,7 +33,7 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## Metadata LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME +LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" diff --git a/build/plugins/assets/shell/welcome b/build/plugins/assets/shell/welcome index c97aea1..bcf4ee7 100644 --- a/build/plugins/assets/shell/welcome +++ b/build/plugins/assets/shell/welcome @@ -8,7 +8,8 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Compiler Collection (gcc, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries and multilib support"; fi +if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries"; fi +if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * GCC Multilib support for platform architectures"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Debugger (gdb) for Ceedling's backtrace feature"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * gcovr for use by GCov plugin"; fi if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * reportgenerator for use by GCov plugin"; fi diff --git a/build/plugins/docker/Dockerfile b/build/plugins/docker/Dockerfile index a375045..2c882ab 100644 --- a/build/plugins/docker/Dockerfile +++ b/build/plugins/docker/Dockerfile @@ -12,6 +12,10 @@ FROM bitnami/minideb:bookworm # recognized platform string (e.g. "linux/amd64"). ARG TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` / +ARG IMAGE_NAME + # This build argument allows setting the image tag at build time to support CI-based builds # The command line must include `--build-arg CONTAINER_VERSION=` ARG CONTAINER_VERSION @@ -19,10 +23,6 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` -ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME - # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -33,7 +33,7 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## Metadata LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME +LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" diff --git a/build/standard/assets/shell/welcome b/build/standard/assets/shell/welcome index f575468..6db3922 100644 --- a/build/standard/assets/shell/welcome +++ b/build/standard/assets/shell/welcome @@ -8,7 +8,8 @@ if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Compiler Collection (gcc, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries and multilib support"; fi +if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries"; fi +if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * GCC Multilib support for platform architectures"; fi if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Debugger (gdb) for Ceedling's backtrace feature"; fi echo "\e[0m" echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." diff --git a/build/standard/docker/Dockerfile b/build/standard/docker/Dockerfile index 380c2f1..691d7bd 100644 --- a/build/standard/docker/Dockerfile +++ b/build/standard/docker/Dockerfile @@ -12,6 +12,10 @@ FROM bitnami/minideb:bookworm # recognized platform string (e.g. "linux/amd64"). ARG TARGETPLATFORM +# Docker image name used for Metadata, set via Docker build argument +# The command line must include `--build-arg IMAGE_NAME=` / +ARG IMAGE_NAME + # This build argument allows setting the image tag at build time to support CI-based builds # The command line must include `--build-arg CONTAINER_VERSION=` ARG CONTAINER_VERSION @@ -19,10 +23,6 @@ ARG CONTAINER_VERSION # Capture TARGETPLATFORM as an environment variable in the image ENV CONTAINER_PLATFORM=$TARGETPLATFORM -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` -ENV MADSCIENCELAB_IMAGE_NAME=$IMAGE_NAME - # Docker image tag for internal container use, set via Docker build argument ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION @@ -33,7 +33,7 @@ ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION ## Metadata LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/throwtheswitch/$MADSCIENCELAB_IMAGE_NAME +LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb LABEL org.opencontainers.image.title="Mad Science Lab" LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" From 01d5b44e741c3445291fe2bf8655dd61bb7a9589 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 12:25:34 -0500 Subject: [PATCH 14/52] =?UTF-8?q?=F0=9F=91=B7=20First=20auto=20prerelease?= =?UTF-8?q?=20with=20artifacts=20experiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 190668a..d0ac150 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -199,3 +199,15 @@ jobs: IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + dockerfiles-prerelease: + runs-on: ubuntu-latest + needs: [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins] + prerelease: true + permissions: + contents: write + + steps: + - uses: ncipollo/release-action@v1 + with: + artifacts: "build/*/docker/Dockerfile" + From 9f2f9c5b68aa305aa6ff205298080657827a0289 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 12:26:57 -0500 Subject: [PATCH 15/52] =?UTF-8?q?=F0=9F=90=9B=20Github=20Action=20prerelea?= =?UTF-8?q?se=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index d0ac150..517de0b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -202,12 +202,12 @@ jobs: dockerfiles-prerelease: runs-on: ubuntu-latest needs: [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins] - prerelease: true permissions: contents: write steps: - uses: ncipollo/release-action@v1 with: + prerelease: true artifacts: "build/*/docker/Dockerfile" From 37169f55fbb801d5d1ed353d56d6c470acb4ee21 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 12:35:10 -0500 Subject: [PATCH 16/52] =?UTF-8?q?=F0=9F=90=9B=20Fix=20prerelease=20Action?= =?UTF-8?q?=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 517de0b..5966024 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -209,5 +209,7 @@ jobs: - uses: ncipollo/release-action@v1 with: prerelease: true + # Use the commit reference for the prerelease name + commit: true artifacts: "build/*/docker/Dockerfile" From bd8be9fa7ec613222d7d8c6ad5d85caada7abbaf Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 12:36:29 -0500 Subject: [PATCH 17/52] =?UTF-8?q?=F0=9F=99=88=20Ignore=20generated=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +- build/arm-none-eabi-plugins/docker/Dockerfile | 177 ----------------- build/arm-none-eabi/docker/Dockerfile | 142 ------------- build/plugins/docker/Dockerfile | 187 ------------------ build/standard/docker/Dockerfile | 152 -------------- 5 files changed, 5 insertions(+), 659 deletions(-) delete mode 100644 build/arm-none-eabi-plugins/docker/Dockerfile delete mode 100644 build/arm-none-eabi/docker/Dockerfile delete mode 100644 build/plugins/docker/Dockerfile delete mode 100644 build/standard/docker/Dockerfile diff --git a/.gitignore b/.gitignore index aef6129..1759c47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ -# OS X junk +# macOS junk .DS_Store + +# Generated artifacts +build/*/docker/Dockerfile +build/*/assets/shell/welcome diff --git a/build/arm-none-eabi-plugins/docker/Dockerfile b/build/arm-none-eabi-plugins/docker/Dockerfile deleted file mode 100644 index f99d4ea..0000000 --- a/build/arm-none-eabi-plugins/docker/Dockerfile +++ /dev/null @@ -1,177 +0,0 @@ -## Base Docker Image -## minideb is a slim Debian base image well maintained by VMWare -## https://github.com/bitnami/minideb -FROM bitnami/minideb:bookworm - -# This image is meant to include multi-platform support via Docker's buildx/BuildKit client and service. -# In recent versions of Docker desktop `docker build` uses the buildx client by default. Under such a build, -# the build argument TARGETPLATFORM is set automatically. -# -# If this image is built without buildx/BuildKit, the build argument below must be set from the command line. -# The command line must include `--build-arg TARGETPLATFORM=` where platform is a Docker- -# recognized platform string (e.g. "linux/amd64"). -ARG TARGETPLATFORM - -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` / -ARG IMAGE_NAME - -# This build argument allows setting the image tag at build time to support CI-based builds -# The command line must include `--build-arg CONTAINER_VERSION=` -ARG CONTAINER_VERSION - -# Capture TARGETPLATFORM as an environment variable in the image -ENV CONTAINER_PLATFORM=$TARGETPLATFORM - -# Docker image tag for internal container use, set via Docker build argument -ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION - -## -## Docker Image Best Practices -## https://docs.docker.com/develop/develop-images/instructions/ -## - -## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME -LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb -LABEL org.opencontainers.image.title="Mad Science Lab" -LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" - -# Image base / set up -RUN set -ex \ - # Update package management environment - && apt update \ - && apt -y upgrade \ - && apt install -y \ - build-essential \ - coreutils \ - gcc-arm-none-eabi \ - gcovr \ - git-all \ - libnewlib-arm-none-eabi \ - locales \ - nano \ - ncurses-bin \ - ruby=1:3.1 \ - subversion \ - unzip \ - valgrind \ - zsh \ - --no-install-recommends \ - && apt autoremove \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* - -## -## Locale setting for Ruby encoding handling -## -## https://stackoverflow.com/questions/17031651/rails-invalid-byte-sequence-in-us-ascii-argument-error-when-i-run-rake-dbsee -## https://www.graalvm.org/latest/reference-manual/ruby/UTF8Locale/ -## - -# Set environment variables -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 - -# Run Debian locale setting operation -RUN set -ex \ - # Uncomment the en_US.UTF-8 line in /etc/locale.gen - && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ - # locale-gen generates locales for all uncommented locales in /etc/locale.gen - && locale-gen - -## -## Copy Ruby assets for inclusion in image -## -## Notes: -## - Gems must be downloaded manually to the vendored bse/assets/gems directory. -## - To find the list of gems and versions needed, visit -## https://rubygems.org/gems/ceedling/versions//dependencies -## - The easiest way to vendor a gem is `gem fetch -v ` with volume mapped to assets/gems. -## -COPY build/base/assets /assets/base - -## -## Copy Dotnet assets for temporary use -## -## Notes: -## - The Microsoft Debian package sources file is needed to install Dotnet -## - The file should be downloaded and vendored to assets/ -## wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb -## -COPY build/plugins/assets /assets/plugins - -# Copy generated shell welcome file into image -COPY build/arm-none-eabi-plugins/assets/shell/welcome /assets/arm-none-eabi-plugins/shell/welcome - - -# Install Ceedling, CMock, Unity, CException + gem dependencies -RUN set -ex \ - # Prevent documentation installation taking up space - echo -e "---\ngem: --no-ri --no-rdoc\n...\n" > .gemrc \ - # Install Ceedling and related gems - && gem install --force --local /assets/base/gems/*.gem \ - && gem install bundler \ - && bundle install --gemfile=/assets/base/gems/Gemfile \ - && rm .gemrc - -# Microsoft Dotnet installation to support `reportgenerator` for `gcov` plugin -# Only available on AMD64 image builds -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ - && dpkg -i /assets/plugins/dotnet/packages-microsoft-prod.deb \ - && apt update \ - && apt install -y \ - dotnet-sdk-8.0 \ - --no-install-recommends \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* ; fi - - -## -## Permissions Security & Cleanup -## - After necessary installations, etc. as root user ensure default container user is not root -## - Create user `dev` (with group 999) and make `dev` the default user -## - Delete /assets directory -## - -RUN set -ex \ - && groupadd -r nonroot --gid 999 \ - && useradd -s /usr/bin/zsh -r -g nonroot dev - -# Set up new user home directory and cleanup /assets -RUN set -ex \ - # Give the new user home directory +rwx permissions to group members - # This will allow us to dynamically specify the host user for the container but give them group permissions - && mkdir -p /home/dev \ - && chown dev:nonroot /home/dev \ - && chmod -R ug+rwx /home/dev \ - # Copy simple Z shell config file & give new user permissions - && cp /assets/base/shell/zshrc-dev /home/dev/.zshrc \ - && chown dev:nonroot /home/dev/.zshrc \ - # Copy welcome file & give new user permissions - && cp /assets/arm-none-eabi-plugins/shell/welcome /home/dev/.welcome \ - && chown dev:nonroot /home/dev/.welcome \ - # Copy simple Z shell config file for root user (for running container as `-u root`) - && cp /assets/base/shell/zshrc-root /root/.zshrc \ - # Cleanup assets - && rm -rf /assets - -# Become / set new user -USER dev - -# Install `reportgenerator` (for `gcov` plugin) -# Only available in AMD64 containers -RUN if [ "$TARGETPLATFORM" == "linux/amd64" ]; then set -ex \ - # Install the dotnet tool as global (which means global for the current user vs. a local directory) - && dotnet tool install --global dotnet-reportgenerator-globaltool \ - # Modify the PATH so the new tool is findable - && echo "[[ -d \"$HOME/.dotnet/tools\" ]] && export PATH=\"$PATH:$HOME/.dotnet/tools\"" >> $HOME/.zshenv ; fi - - -WORKDIR /home/dev/project - -# When the container launches, run a shell that launches in WORKDIR -CMD ["/usr/bin/zsh"] - diff --git a/build/arm-none-eabi/docker/Dockerfile b/build/arm-none-eabi/docker/Dockerfile deleted file mode 100644 index 03f41e9..0000000 --- a/build/arm-none-eabi/docker/Dockerfile +++ /dev/null @@ -1,142 +0,0 @@ -## Base Docker Image -## minideb is a slim Debian base image well maintained by VMWare -## https://github.com/bitnami/minideb -FROM bitnami/minideb:bookworm - -# This image is meant to include multi-platform support via Docker's buildx/BuildKit client and service. -# In recent versions of Docker desktop `docker build` uses the buildx client by default. Under such a build, -# the build argument TARGETPLATFORM is set automatically. -# -# If this image is built without buildx/BuildKit, the build argument below must be set from the command line. -# The command line must include `--build-arg TARGETPLATFORM=` where platform is a Docker- -# recognized platform string (e.g. "linux/amd64"). -ARG TARGETPLATFORM - -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` / -ARG IMAGE_NAME - -# This build argument allows setting the image tag at build time to support CI-based builds -# The command line must include `--build-arg CONTAINER_VERSION=` -ARG CONTAINER_VERSION - -# Capture TARGETPLATFORM as an environment variable in the image -ENV CONTAINER_PLATFORM=$TARGETPLATFORM - -# Docker image tag for internal container use, set via Docker build argument -ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION - -## -## Docker Image Best Practices -## https://docs.docker.com/develop/develop-images/instructions/ -## - -## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME -LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb -LABEL org.opencontainers.image.title="Mad Science Lab" -LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" - -# Image base / set up -RUN set -ex \ - # Update package management environment - && apt update \ - && apt -y upgrade \ - && apt install -y \ - build-essential \ - coreutils \ - gcc-arm-none-eabi \ - libnewlib-arm-none-eabi \ - locales \ - nano \ - ruby=1:3.1 \ - zsh \ - --no-install-recommends \ - && apt autoremove \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* - -## -## Locale setting for Ruby encoding handling -## -## https://stackoverflow.com/questions/17031651/rails-invalid-byte-sequence-in-us-ascii-argument-error-when-i-run-rake-dbsee -## https://www.graalvm.org/latest/reference-manual/ruby/UTF8Locale/ -## - -# Set environment variables -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 - -# Run Debian locale setting operation -RUN set -ex \ - # Uncomment the en_US.UTF-8 line in /etc/locale.gen - && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ - # locale-gen generates locales for all uncommented locales in /etc/locale.gen - && locale-gen - -## -## Copy Ruby assets for inclusion in image -## -## Notes: -## - Gems must be downloaded manually to the vendored bse/assets/gems directory. -## - To find the list of gems and versions needed, visit -## https://rubygems.org/gems/ceedling/versions//dependencies -## - The easiest way to vendor a gem is `gem fetch -v ` with volume mapped to assets/gems. -## -COPY build/base/assets /assets/base - -# Copy generated shell welcome file into image -COPY build/arm-none-eabi/assets/shell/welcome /assets/arm-none-eabi/shell/welcome - - -# Install Ceedling, CMock, Unity, CException + gem dependencies -RUN set -ex \ - # Prevent documentation installation taking up space - echo -e "---\ngem: --no-ri --no-rdoc\n...\n" > .gemrc \ - # Install Ceedling and related gems - && gem install --force --local /assets/base/gems/*.gem \ - && gem install bundler \ - && bundle install --gemfile=/assets/base/gems/Gemfile \ - && rm .gemrc - - -## -## Permissions Security & Cleanup -## - After necessary installations, etc. as root user ensure default container user is not root -## - Create user `dev` (with group 999) and make `dev` the default user -## - Delete /assets directory -## - -RUN set -ex \ - && groupadd -r nonroot --gid 999 \ - && useradd -s /usr/bin/zsh -r -g nonroot dev - -# Set up new user home directory and cleanup /assets -RUN set -ex \ - # Give the new user home directory +rwx permissions to group members - # This will allow us to dynamically specify the host user for the container but give them group permissions - && mkdir -p /home/dev \ - && chown dev:nonroot /home/dev \ - && chmod -R ug+rwx /home/dev \ - # Copy simple Z shell config file & give new user permissions - && cp /assets/base/shell/zshrc-dev /home/dev/.zshrc \ - && chown dev:nonroot /home/dev/.zshrc \ - # Copy welcome file & give new user permissions - && cp /assets/arm-none-eabi/shell/welcome /home/dev/.welcome \ - && chown dev:nonroot /home/dev/.welcome \ - # Copy simple Z shell config file for root user (for running container as `-u root`) - && cp /assets/base/shell/zshrc-root /root/.zshrc \ - # Cleanup assets - && rm -rf /assets - -# Become / set new user -USER dev - - -WORKDIR /home/dev/project - -# When the container launches, run a shell that launches in WORKDIR -CMD ["/usr/bin/zsh"] - diff --git a/build/plugins/docker/Dockerfile b/build/plugins/docker/Dockerfile deleted file mode 100644 index 2c882ab..0000000 --- a/build/plugins/docker/Dockerfile +++ /dev/null @@ -1,187 +0,0 @@ -## Base Docker Image -## minideb is a slim Debian base image well maintained by VMWare -## https://github.com/bitnami/minideb -FROM bitnami/minideb:bookworm - -# This image is meant to include multi-platform support via Docker's buildx/BuildKit client and service. -# In recent versions of Docker desktop `docker build` uses the buildx client by default. Under such a build, -# the build argument TARGETPLATFORM is set automatically. -# -# If this image is built without buildx/BuildKit, the build argument below must be set from the command line. -# The command line must include `--build-arg TARGETPLATFORM=` where platform is a Docker- -# recognized platform string (e.g. "linux/amd64"). -ARG TARGETPLATFORM - -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` / -ARG IMAGE_NAME - -# This build argument allows setting the image tag at build time to support CI-based builds -# The command line must include `--build-arg CONTAINER_VERSION=` -ARG CONTAINER_VERSION - -# Capture TARGETPLATFORM as an environment variable in the image -ENV CONTAINER_PLATFORM=$TARGETPLATFORM - -# Docker image tag for internal container use, set via Docker build argument -ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION - -## -## Docker Image Best Practices -## https://docs.docker.com/develop/develop-images/instructions/ -## - -## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME -LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb -LABEL org.opencontainers.image.title="Mad Science Lab" -LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" - -# Image base / set up -RUN set -ex \ - # Update package management environment - && apt update \ - && apt -y upgrade \ - && apt install -y \ - build-essential \ - coreutils \ - gcc \ - gcovr \ - gdb \ - git-all \ - libc-dev \ - locales \ - nano \ - ncurses-bin \ - ruby=1:3.1 \ - subversion \ - unzip \ - valgrind \ - zsh \ - --no-install-recommends \ - && apt autoremove \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* - -## -## Locale setting for Ruby encoding handling -## -## https://stackoverflow.com/questions/17031651/rails-invalid-byte-sequence-in-us-ascii-argument-error-when-i-run-rake-dbsee -## https://www.graalvm.org/latest/reference-manual/ruby/UTF8Locale/ -## - -# Set environment variables -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 - -# Run Debian locale setting operation -RUN set -ex \ - # Uncomment the en_US.UTF-8 line in /etc/locale.gen - && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ - # locale-gen generates locales for all uncommented locales in /etc/locale.gen - && locale-gen - -## -## Copy Ruby assets for inclusion in image -## -## Notes: -## - Gems must be downloaded manually to the vendored bse/assets/gems directory. -## - To find the list of gems and versions needed, visit -## https://rubygems.org/gems/ceedling/versions//dependencies -## - The easiest way to vendor a gem is `gem fetch -v ` with volume mapped to assets/gems. -## -COPY build/base/assets /assets/base - -## -## Copy Dotnet assets for temporary use -## -## Notes: -## - The Microsoft Debian package sources file is needed to install Dotnet -## - The file should be downloaded and vendored to assets/ -## wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb -## -COPY build/plugins/assets /assets/plugins - -# Copy generated shell welcome file into image -COPY build/plugins/assets/shell/welcome /assets/plugins/shell/welcome - - -# Install Ceedling, CMock, Unity, CException + gem dependencies -RUN set -ex \ - # Prevent documentation installation taking up space - echo -e "---\ngem: --no-ri --no-rdoc\n...\n" > .gemrc \ - # Install Ceedling and related gems - && gem install --force --local /assets/base/gems/*.gem \ - && gem install bundler \ - && bundle install --gemfile=/assets/base/gems/Gemfile \ - && rm .gemrc - -# gcc-multilib for processor architectures is only available for AMD64 image builds -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ - && apt update \ - && apt install -y \ - gcc-multilib \ - --no-install-recommends \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* ; fi - -# Microsoft Dotnet installation to support `reportgenerator` for `gcov` plugin -# Only available on AMD64 image builds -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ - && dpkg -i /assets/plugins/dotnet/packages-microsoft-prod.deb \ - && apt update \ - && apt install -y \ - dotnet-sdk-8.0 \ - --no-install-recommends \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* ; fi - - -## -## Permissions Security & Cleanup -## - After necessary installations, etc. as root user ensure default container user is not root -## - Create user `dev` (with group 999) and make `dev` the default user -## - Delete /assets directory -## - -RUN set -ex \ - && groupadd -r nonroot --gid 999 \ - && useradd -s /usr/bin/zsh -r -g nonroot dev - -# Set up new user home directory and cleanup /assets -RUN set -ex \ - # Give the new user home directory +rwx permissions to group members - # This will allow us to dynamically specify the host user for the container but give them group permissions - && mkdir -p /home/dev \ - && chown dev:nonroot /home/dev \ - && chmod -R ug+rwx /home/dev \ - # Copy simple Z shell config file & give new user permissions - && cp /assets/base/shell/zshrc-dev /home/dev/.zshrc \ - && chown dev:nonroot /home/dev/.zshrc \ - # Copy welcome file & give new user permissions - && cp /assets/plugins/shell/welcome /home/dev/.welcome \ - && chown dev:nonroot /home/dev/.welcome \ - # Copy simple Z shell config file for root user (for running container as `-u root`) - && cp /assets/base/shell/zshrc-root /root/.zshrc \ - # Cleanup assets - && rm -rf /assets - -# Become / set new user -USER dev - -# Install `reportgenerator` (for `gcov` plugin) -# Only available in AMD64 containers -RUN if [ "$TARGETPLATFORM" == "linux/amd64" ]; then set -ex \ - # Install the dotnet tool as global (which means global for the current user vs. a local directory) - && dotnet tool install --global dotnet-reportgenerator-globaltool \ - # Modify the PATH so the new tool is findable - && echo "[[ -d \"$HOME/.dotnet/tools\" ]] && export PATH=\"$PATH:$HOME/.dotnet/tools\"" >> $HOME/.zshenv ; fi - - -WORKDIR /home/dev/project - -# When the container launches, run a shell that launches in WORKDIR -CMD ["/usr/bin/zsh"] - diff --git a/build/standard/docker/Dockerfile b/build/standard/docker/Dockerfile deleted file mode 100644 index 691d7bd..0000000 --- a/build/standard/docker/Dockerfile +++ /dev/null @@ -1,152 +0,0 @@ -## Base Docker Image -## minideb is a slim Debian base image well maintained by VMWare -## https://github.com/bitnami/minideb -FROM bitnami/minideb:bookworm - -# This image is meant to include multi-platform support via Docker's buildx/BuildKit client and service. -# In recent versions of Docker desktop `docker build` uses the buildx client by default. Under such a build, -# the build argument TARGETPLATFORM is set automatically. -# -# If this image is built without buildx/BuildKit, the build argument below must be set from the command line. -# The command line must include `--build-arg TARGETPLATFORM=` where platform is a Docker- -# recognized platform string (e.g. "linux/amd64"). -ARG TARGETPLATFORM - -# Docker image name used for Metadata, set via Docker build argument -# The command line must include `--build-arg IMAGE_NAME=` / -ARG IMAGE_NAME - -# This build argument allows setting the image tag at build time to support CI-based builds -# The command line must include `--build-arg CONTAINER_VERSION=` -ARG CONTAINER_VERSION - -# Capture TARGETPLATFORM as an environment variable in the image -ENV CONTAINER_PLATFORM=$TARGETPLATFORM - -# Docker image tag for internal container use, set via Docker build argument -ENV MADSCIENCELAB_VERSION=$CONTAINER_VERSION - -## -## Docker Image Best Practices -## https://docs.docker.com/develop/develop-images/instructions/ -## - -## Metadata -LABEL org.opencontainers.image.source=https://github.com/ThrowTheSwitch/MadScienceLabDocker/releases -LABEL org.opencontainers.image.url=https://hub.docker.com/r/$IMAGE_NAME -LABEL org.opencontainers.image.base.name=docker.io/bitnami/minideb -LABEL org.opencontainers.image.title="Mad Science Lab" -LABEL org.opencontainers.image.description="Contains Ceedling, supporting frameworks, and GNU C toolchain to provide a unit testing and build system environment for C projects" - -# Image base / set up -RUN set -ex \ - # Update package management environment - && apt update \ - && apt -y upgrade \ - && apt install -y \ - build-essential \ - coreutils \ - gcc \ - gdb \ - libc-dev \ - locales \ - nano \ - ruby=1:3.1 \ - zsh \ - --no-install-recommends \ - && apt autoremove \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* - -## -## Locale setting for Ruby encoding handling -## -## https://stackoverflow.com/questions/17031651/rails-invalid-byte-sequence-in-us-ascii-argument-error-when-i-run-rake-dbsee -## https://www.graalvm.org/latest/reference-manual/ruby/UTF8Locale/ -## - -# Set environment variables -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 - -# Run Debian locale setting operation -RUN set -ex \ - # Uncomment the en_US.UTF-8 line in /etc/locale.gen - && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ - # locale-gen generates locales for all uncommented locales in /etc/locale.gen - && locale-gen - -## -## Copy Ruby assets for inclusion in image -## -## Notes: -## - Gems must be downloaded manually to the vendored bse/assets/gems directory. -## - To find the list of gems and versions needed, visit -## https://rubygems.org/gems/ceedling/versions//dependencies -## - The easiest way to vendor a gem is `gem fetch -v ` with volume mapped to assets/gems. -## -COPY build/base/assets /assets/base - -# Copy generated shell welcome file into image -COPY build/standard/assets/shell/welcome /assets/standard/shell/welcome - - -# Install Ceedling, CMock, Unity, CException + gem dependencies -RUN set -ex \ - # Prevent documentation installation taking up space - echo -e "---\ngem: --no-ri --no-rdoc\n...\n" > .gemrc \ - # Install Ceedling and related gems - && gem install --force --local /assets/base/gems/*.gem \ - && gem install bundler \ - && bundle install --gemfile=/assets/base/gems/Gemfile \ - && rm .gemrc - -# gcc-multilib for processor architectures is only available for AMD64 image builds -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ - && apt update \ - && apt install -y \ - gcc-multilib \ - --no-install-recommends \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* ; fi - - -## -## Permissions Security & Cleanup -## - After necessary installations, etc. as root user ensure default container user is not root -## - Create user `dev` (with group 999) and make `dev` the default user -## - Delete /assets directory -## - -RUN set -ex \ - && groupadd -r nonroot --gid 999 \ - && useradd -s /usr/bin/zsh -r -g nonroot dev - -# Set up new user home directory and cleanup /assets -RUN set -ex \ - # Give the new user home directory +rwx permissions to group members - # This will allow us to dynamically specify the host user for the container but give them group permissions - && mkdir -p /home/dev \ - && chown dev:nonroot /home/dev \ - && chmod -R ug+rwx /home/dev \ - # Copy simple Z shell config file & give new user permissions - && cp /assets/base/shell/zshrc-dev /home/dev/.zshrc \ - && chown dev:nonroot /home/dev/.zshrc \ - # Copy welcome file & give new user permissions - && cp /assets/standard/shell/welcome /home/dev/.welcome \ - && chown dev:nonroot /home/dev/.welcome \ - # Copy simple Z shell config file for root user (for running container as `-u root`) - && cp /assets/base/shell/zshrc-root /root/.zshrc \ - # Cleanup assets - && rm -rf /assets - -# Become / set new user -USER dev - - -WORKDIR /home/dev/project - -# When the container launches, run a shell that launches in WORKDIR -CMD ["/usr/bin/zsh"] - From 4669d63d1bad97a3103e934332227c21a1f3697c Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 12:38:05 -0500 Subject: [PATCH 18/52] =?UTF-8?q?=F0=9F=99=88=20Remove=20generated=20welco?= =?UTF-8?q?me=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/shell/welcome | 23 ----------------- build/arm-none-eabi/assets/shell/welcome | 17 ------------- build/plugins/assets/shell/welcome | 25 ------------------- build/standard/assets/shell/welcome | 19 -------------- 4 files changed, 84 deletions(-) delete mode 100644 build/arm-none-eabi-plugins/assets/shell/welcome delete mode 100644 build/arm-none-eabi/assets/shell/welcome delete mode 100644 build/plugins/assets/shell/welcome delete mode 100644 build/standard/assets/shell/welcome diff --git a/build/arm-none-eabi-plugins/assets/shell/welcome b/build/arm-none-eabi-plugins/assets/shell/welcome deleted file mode 100644 index 34cb344..0000000 --- a/build/arm-none-eabi-plugins/assets/shell/welcome +++ /dev/null @@ -1,23 +0,0 @@ -echo "" -echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" -echo "\e[37m" -echo " This container includes:" -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * GNU Compiler Collection (gcc, etc.) for ARM"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries (ARM)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * gcovr for use by GCov plugin"; fi -if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * reportgenerator for use by GCov plugin"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * unzip, git & svn for use by Dependencies plugin"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * tput for use by Beep plugin"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Python 3, needed by gcovr"; fi -if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * Dotnet 8, needed by reportgenerator"; fi -echo "\e[0m" -echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." -echo " This limits installing software and more. See Docker Hub page for container security docs and options." -echo "\e[33m" -echo " To get started, enter \`ceedling help\` at the command line..." -echo "\e[0m" diff --git a/build/arm-none-eabi/assets/shell/welcome b/build/arm-none-eabi/assets/shell/welcome deleted file mode 100644 index 55b0540..0000000 --- a/build/arm-none-eabi/assets/shell/welcome +++ /dev/null @@ -1,17 +0,0 @@ -echo "" -echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" -echo "\e[37m" -echo " This container includes:" -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * GNU Compiler Collection (gcc, etc.) for ARM"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries (ARM)"; fi -echo "\e[0m" -echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." -echo " This limits installing software and more. See Docker Hub page for container security docs and options." -echo "\e[33m" -echo " To get started, enter \`ceedling help\` at the command line..." -echo "\e[0m" diff --git a/build/plugins/assets/shell/welcome b/build/plugins/assets/shell/welcome deleted file mode 100644 index bcf4ee7..0000000 --- a/build/plugins/assets/shell/welcome +++ /dev/null @@ -1,25 +0,0 @@ -echo "" -echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" -echo "\e[37m" -echo " This container includes:" -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Compiler Collection (gcc, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries"; fi -if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * GCC Multilib support for platform architectures"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Debugger (gdb) for Ceedling's backtrace feature"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * gcovr for use by GCov plugin"; fi -if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * reportgenerator for use by GCov plugin"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * unzip, git & svn for use by Dependencies plugin"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * tput for use by Beep plugin"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Python 3, needed by gcovr"; fi -if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * Dotnet 8, needed by reportgenerator"; fi -echo "\e[0m" -echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." -echo " This limits installing software and more. See Docker Hub page for container security docs and options." -echo "\e[33m" -echo " To get started, enter \`ceedling help\` at the command line..." -echo "\e[0m" diff --git a/build/standard/assets/shell/welcome b/build/standard/assets/shell/welcome deleted file mode 100644 index 6db3922..0000000 --- a/build/standard/assets/shell/welcome +++ /dev/null @@ -1,19 +0,0 @@ -echo "" -echo "\e[35mWelcome to the Mad Science Lab $MADSCIENCELAB_VERSION \e[0m" -echo "\e[37m" -echo " This container includes:" -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ceedling, Unity, CMock & CException"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Ruby 3"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential Unix utilities"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Essential build tools (make, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * nano for simple text editing"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Compiler Collection (gcc, etc.)"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * Standard C libraries"; fi -if [[ "$CONTAINER_PLATFORM" == linux/amd64 ]]; then echo " * GCC Multilib support for platform architectures"; fi -if [[ "$CONTAINER_PLATFORM" == * ]]; then echo " * The GNU Debugger (gdb) for Ceedling's backtrace feature"; fi -echo "\e[0m" -echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." -echo " This limits installing software and more. See Docker Hub page for container security docs and options." -echo "\e[33m" -echo " To get started, enter \`ceedling help\` at the command line..." -echo "\e[0m" From 9a897a6721ede784af77ea748c3ffaf925dc8b46 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 13:19:53 -0500 Subject: [PATCH 19/52] =?UTF-8?q?=F0=9F=91=B7=20Incorporating=20file=20gen?= =?UTF-8?q?eration=20into=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5966024..701b46c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -42,9 +42,17 @@ jobs: IMAGE_URL: ${{ needs.image-details.outputs.base-url }} steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Run file generation' + run: bash build.sh --dir build/standard --version dev + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -86,9 +94,17 @@ jobs: IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-plugins steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Run file generation' + run: bash build.sh --dir build/standard --dir build/plugins --version dev + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -129,9 +145,17 @@ jobs: IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Run file generation' + run: bash build.sh --dir build/arm-none-eabi --version dev + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -172,9 +196,17 @@ jobs: IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Run file generation' + run: bash build.sh --dir build/arm-none-eabi --dir build/plugins --dir build/arm-none-eabi-plugins --version dev + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -211,5 +243,5 @@ jobs: prerelease: true # Use the commit reference for the prerelease name commit: true - artifacts: "build/*/docker/Dockerfile" + artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" From eb206a02941d4a9942ad01aefea379f287aa2b2a Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 13:22:11 -0500 Subject: [PATCH 20/52] =?UTF-8?q?=F0=9F=91=B7=20Add=20Ruby=20version=20to?= =?UTF-8?q?=20Github=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 701b46c..74d07f4 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -45,6 +45,7 @@ jobs: - name: 'Set up Ruby for generation tool' uses: ruby/setup-ruby@v1 with: + ruby-version: '3.3' bundler-cache: true - name: 'Checkout GitHub Action' @@ -97,6 +98,7 @@ jobs: - name: 'Set up Ruby for generation tool' uses: ruby/setup-ruby@v1 with: + ruby-version: '3.3' bundler-cache: true - name: 'Checkout GitHub Action' @@ -148,6 +150,7 @@ jobs: - name: 'Set up Ruby for generation tool' uses: ruby/setup-ruby@v1 with: + ruby-version: '3.3' bundler-cache: true - name: 'Checkout GitHub Action' @@ -199,6 +202,7 @@ jobs: - name: 'Set up Ruby for generation tool' uses: ruby/setup-ruby@v1 with: + ruby-version: '3.3' bundler-cache: true - name: 'Checkout GitHub Action' From a3a02aa32ccc78673e8b7b388b90f4a983e5b37b Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 13:26:24 -0500 Subject: [PATCH 21/52] =?UTF-8?q?=F0=9F=91=B7=20Add=20file=20generation=20?= =?UTF-8?q?gem=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..32946d1 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source "http://rubygems.org/" + +# File generation dependencies +gem "thor", "~> 1.3" +gem "erb", "~> 4.0" \ No newline at end of file From ca7ddf85ea0ccc440a6e40c1ebe183967bd45d16 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 13:29:56 -0500 Subject: [PATCH 22/52] =?UTF-8?q?=F0=9F=91=B7=20Run=20bundler=20install=20?= =?UTF-8?q?of=20Ruby=20gems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 74d07f4..4fdbfe8 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -47,10 +47,13 @@ jobs: with: ruby-version: '3.3' bundler-cache: true - + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + - name: 'Run file generation' run: bash build.sh --dir build/standard --version dev @@ -104,6 +107,9 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + - name: 'Run file generation' run: bash build.sh --dir build/standard --dir build/plugins --version dev @@ -156,6 +162,9 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + - name: 'Run file generation' run: bash build.sh --dir build/arm-none-eabi --version dev @@ -208,6 +217,9 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + - name: 'Run file generation' run: bash build.sh --dir build/arm-none-eabi --dir build/plugins --dir build/arm-none-eabi-plugins --version dev From c624a0e4f6e22b1ae8a6e56a7b217fc3d0b11e4d Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 13:40:15 -0500 Subject: [PATCH 23/52] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20intentionally=20em?= =?UTF-8?q?pty=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/arm-none-eabi-plugins/assets/.gitkeep | 0 build/arm-none-eabi-plugins/assets/shell/.gitkeep | 0 build/arm-none-eabi-plugins/docker/.gitkeep | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 build/arm-none-eabi-plugins/assets/.gitkeep create mode 100644 build/arm-none-eabi-plugins/assets/shell/.gitkeep create mode 100644 build/arm-none-eabi-plugins/docker/.gitkeep diff --git a/build/arm-none-eabi-plugins/assets/.gitkeep b/build/arm-none-eabi-plugins/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/arm-none-eabi-plugins/assets/shell/.gitkeep b/build/arm-none-eabi-plugins/assets/shell/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/arm-none-eabi-plugins/docker/.gitkeep b/build/arm-none-eabi-plugins/docker/.gitkeep new file mode 100644 index 0000000..e69de29 From 25813d2317913723f600e6bf94d781fc8848bb21 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:07:53 -0500 Subject: [PATCH 24/52] =?UTF-8?q?=F0=9F=91=B7=20Github=20Action=20file=20g?= =?UTF-8?q?en=20path=20handling=20experiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4fdbfe8..b5f4d12 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -55,7 +55,10 @@ jobs: run: bundle install - name: 'Run file generation' - run: bash build.sh --dir build/standard --version dev + id: file-gen + run: | + bash build.sh --dir build/standard --version dev + echo "PATH=$(pwd)/build/standard" >> $GITHUB_OUTPUT - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -76,7 +79,7 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/standard/docker/Dockerfile + file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} From 31efb461091d4545b39d25ca7494a4c13eee335e Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:17:09 -0500 Subject: [PATCH 25/52] =?UTF-8?q?=F0=9F=91=B7=20More=20Github=20Action=20d?= =?UTF-8?q?irectory=20path=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index b5f4d12..35ae009 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -79,7 +79,8 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile + directory: ${{ steps.file-gen.outputs.PATH }} + file: docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} From 80f6747ce602bd6d198df57a166d71612fd21ef3 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:26:11 -0500 Subject: [PATCH 26/52] =?UTF-8?q?=F0=9F=91=B7=20More=20Github=20Action=20p?= =?UTF-8?q?ath=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 35ae009..fa882df 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -79,7 +79,7 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - directory: ${{ steps.file-gen.outputs.PATH }} + context: ${{ steps.file-gen.outputs.PATH }} file: docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} From 1bda3326aa5ba14ed5597656720a8ba402255684 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:38:21 -0500 Subject: [PATCH 27/52] =?UTF-8?q?=F0=9F=91=B7=20Ensure=20empty=20directori?= =?UTF-8?q?es=20exist=20in=20repo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/arm-none-eabi/assets/.gitkeep | 0 build/arm-none-eabi/assets/shell/.gitkeep | 0 build/arm-none-eabi/docker/.gitkeep | 0 build/plugins/assets/.gitkeep | 0 build/plugins/assets/shell/.gitkeep | 0 build/plugins/docker/.gitkeep | 0 build/standard/assets/.gitkeep | 0 build/standard/assets/shell/.gitkeep | 0 build/standard/docker/.gitkeep | 0 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 build/arm-none-eabi/assets/.gitkeep create mode 100644 build/arm-none-eabi/assets/shell/.gitkeep create mode 100644 build/arm-none-eabi/docker/.gitkeep create mode 100644 build/plugins/assets/.gitkeep create mode 100644 build/plugins/assets/shell/.gitkeep create mode 100644 build/plugins/docker/.gitkeep create mode 100644 build/standard/assets/.gitkeep create mode 100644 build/standard/assets/shell/.gitkeep create mode 100644 build/standard/docker/.gitkeep diff --git a/build/arm-none-eabi/assets/.gitkeep b/build/arm-none-eabi/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/arm-none-eabi/assets/shell/.gitkeep b/build/arm-none-eabi/assets/shell/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/arm-none-eabi/docker/.gitkeep b/build/arm-none-eabi/docker/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/plugins/assets/.gitkeep b/build/plugins/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/plugins/assets/shell/.gitkeep b/build/plugins/assets/shell/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/plugins/docker/.gitkeep b/build/plugins/docker/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/standard/assets/.gitkeep b/build/standard/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/standard/assets/shell/.gitkeep b/build/standard/assets/shell/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build/standard/docker/.gitkeep b/build/standard/docker/.gitkeep new file mode 100644 index 0000000..e69de29 From 52e336de30b257ef711ac3db96179ab9819c407c Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:39:32 -0500 Subject: [PATCH 28/52] =?UTF-8?q?=F0=9F=91=B7=20Explicit=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index fa882df..42f274e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -58,7 +58,7 @@ jobs: id: file-gen run: | bash build.sh --dir build/standard --version dev - echo "PATH=$(pwd)/build/standard" >> $GITHUB_OUTPUT + echo "PATH=$(pwd)/build/standard/" >> $GITHUB_OUTPUT - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 From 76026af4e67146b33e09f9e9f605966170da153f Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:53:45 -0500 Subject: [PATCH 29/52] =?UTF-8?q?=F0=9F=91=B7=20Path=20experiments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 42f274e..4b9b765 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -85,6 +85,7 @@ jobs: CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + run: ls -al ${{ steps.file-gen.outputs.PATH }} madsciencelab-plugins: runs-on: ubuntu-latest From 121f0b2b568bc3367870c5fcb6bd383df41397b6 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:55:44 -0500 Subject: [PATCH 30/52] =?UTF-8?q?=F0=9F=91=B7=20Path=20debugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4b9b765..c936d51 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -73,6 +73,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: 'Debug' + run: | + ls -al ${{ steps.file-gen.outputs.PATH }} + tree ${{ steps.file-gen.outputs.PATH }} + + # Docker image: madsciencelab # Note: standard/ directory maps to madsciencelab image (no variants) - name: 'Build Docker image ${{ env.IMAGE_NAME }}' @@ -85,7 +91,6 @@ jobs: CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest - run: ls -al ${{ steps.file-gen.outputs.PATH }} madsciencelab-plugins: runs-on: ubuntu-latest From bebe9c4eaf07cf393c3e6a7f3c5ad154881c9fdf Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 14:59:26 -0500 Subject: [PATCH 31/52] =?UTF-8?q?=F0=9F=91=B7=20More=20path=20debugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index c936d51..4177e58 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -58,7 +58,7 @@ jobs: id: file-gen run: | bash build.sh --dir build/standard --version dev - echo "PATH=$(pwd)/build/standard/" >> $GITHUB_OUTPUT + echo "PATH=$(pwd)/build/standard" >> $GITHUB_OUTPUT - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -73,12 +73,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: 'Debug' - run: | - ls -al ${{ steps.file-gen.outputs.PATH }} - tree ${{ steps.file-gen.outputs.PATH }} - - # Docker image: madsciencelab # Note: standard/ directory maps to madsciencelab image (no variants) - name: 'Build Docker image ${{ env.IMAGE_NAME }}' @@ -86,7 +80,7 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: ${{ steps.file-gen.outputs.PATH }} - file: docker/Dockerfile + file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} From 76e662423ebe90da2c8eb9341cf9d2414cafe42d Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 15:12:26 -0500 Subject: [PATCH 32/52] =?UTF-8?q?=F0=9F=91=B7=20Docker=20/=20Github=20cach?= =?UTF-8?q?e=20fix=20experiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4177e58..e08cf10 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -73,6 +73,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: 'Extract metadata for Docker Hub' + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_URL }} + # Docker image: madsciencelab # Note: standard/ directory maps to madsciencelab image (no variants) - name: 'Build Docker image ${{ env.IMAGE_NAME }}' @@ -80,11 +86,13 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: ${{ steps.file-gen.outputs.PATH }} - file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile + file: docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha madsciencelab-plugins: runs-on: ubuntu-latest From 9f5764b5a0d93c1c948ebb3abaccce6d45385004 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 15:15:26 -0500 Subject: [PATCH 33/52] =?UTF-8?q?=F0=9F=91=B7=20More=20cache=20&=20path=20?= =?UTF-8?q?fix=20experiments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index e08cf10..53eedbf 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -73,12 +73,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: 'Extract metadata for Docker Hub' - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.IMAGE_URL }} - # Docker image: madsciencelab # Note: standard/ directory maps to madsciencelab image (no variants) - name: 'Build Docker image ${{ env.IMAGE_NAME }}' @@ -86,12 +80,11 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: ${{ steps.file-gen.outputs.PATH }} - file: docker/Dockerfile + file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest - labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha madsciencelab-plugins: From c97cd201b3763bbf2cb17c382abaf3eb93546734 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 15:27:56 -0500 Subject: [PATCH 34/52] =?UTF-8?q?=F0=9F=91=B7=20Still=20more=20path,=20con?= =?UTF-8?q?text=20&=20cache=20experiments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 53eedbf..faa11e9 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -79,13 +79,17 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - context: ${{ steps.file-gen.outputs.PATH }} - file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile + # context: ${{ steps.file-gen.outputs.PATH }} + # file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile + context: build/standard/ + file: build/standard/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service cache-from: type=gha + cache-to: type=gha,mode=max madsciencelab-plugins: runs-on: ubuntu-latest From 21540180e44db38c2a0761d2c84c2f164669a4d1 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 15:30:29 -0500 Subject: [PATCH 35/52] =?UTF-8?q?=F0=9F=91=B7=20More=20Docker=20context=20?= =?UTF-8?q?experiments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index faa11e9..0367913 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -81,7 +81,7 @@ jobs: platforms: linux/amd64,linux/arm64 # context: ${{ steps.file-gen.outputs.PATH }} # file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile - context: build/standard/ + context: . file: build/standard/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} From 8ec9166b9486d669f72cdd7d50b5b56e2164ea46 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 15:42:33 -0500 Subject: [PATCH 36/52] =?UTF-8?q?=F0=9F=91=B7=20Fixes=20for=20Docker=20con?= =?UTF-8?q?text=20in=20remaining=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 49 +++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 0367913..5d45bb1 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -38,8 +38,8 @@ jobs: id-token: write env: IMAGE_NAME: ${{ needs.image-details.outputs.base-name }} - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }} + IMAGE_DIR: build/standard steps: - name: 'Set up Ruby for generation tool' @@ -56,9 +56,7 @@ jobs: - name: 'Run file generation' id: file-gen - run: | - bash build.sh --dir build/standard --version dev - echo "PATH=$(pwd)/build/standard" >> $GITHUB_OUTPUT + run: bash build.sh --dir ${{ env.IMAGE_DIR }} --version dev - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -79,10 +77,8 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - # context: ${{ steps.file-gen.outputs.PATH }} - # file: ${{ steps.file-gen.outputs.PATH }}/docker/Dockerfile context: . - file: build/standard/docker/Dockerfile + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} @@ -100,11 +96,10 @@ jobs: attestations: write id-token: write env: - VARIANT: 'plugins' - # Cannot reference VARIANT as it does not exist yet + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-plugins - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-plugins + IMAGE_DIR: build/plugins steps: - name: 'Set up Ruby for generation tool' @@ -120,7 +115,7 @@ jobs: run: bundle install - name: 'Run file generation' - run: bash build.sh --dir build/standard --dir build/plugins --version dev + run: bash build.sh --dir build/standard --dir ${{ env.IMAGE_DIR }} --version dev - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -140,11 +135,15 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/${{ env.VARIANT }}/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max madsciencelab-arm-none-eabi: runs-on: ubuntu-latest @@ -155,11 +154,10 @@ jobs: attestations: write id-token: write env: - VARIANT: 'arm-none-eabi' - # Cannot reference VARIANT as it does not exist yet + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi + IMAGE_DIR: build/arm-none-eabi steps: - name: 'Set up Ruby for generation tool' @@ -175,7 +173,7 @@ jobs: run: bundle install - name: 'Run file generation' - run: bash build.sh --dir build/arm-none-eabi --version dev + run: bash build.sh --dir ${{ env.IMAGE_DIR }} --version dev - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -195,11 +193,15 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/${{ env.VARIANT }}/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest @@ -210,11 +212,10 @@ jobs: attestations: write id-token: write env: - VARIANT: 'arm-none-eabi-plugins' - # Cannot reference VARIANT as it does not exist yet + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi-plugins - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins + IMAGE_DIR: build/arm-none-eabi-plugins steps: - name: 'Set up Ruby for generation tool' @@ -230,7 +231,7 @@ jobs: run: bundle install - name: 'Run file generation' - run: bash build.sh --dir build/arm-none-eabi --dir build/plugins --dir build/arm-none-eabi-plugins --version dev + run: bash build.sh --dir build/arm-none-eabi --dir build/plugins --dir ${{ env.IMAGE_DIR }} --version dev - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -250,11 +251,15 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/${{ env.VARIANT }}/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max dockerfiles-prerelease: runs-on: ubuntu-latest From 0e5d0a8ee96cdeefd9fd724a3fb1354d87154b03 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:03:29 -0500 Subject: [PATCH 37/52] =?UTF-8?q?=F0=9F=91=B7=20Prerelease=20config=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5d45bb1..1a5cc2f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -271,7 +271,7 @@ jobs: - uses: ncipollo/release-action@v1 with: prerelease: true - # Use the commit reference for the prerelease name - commit: true + allowUpdates: true + tag: ${{ github.ref }} artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" From cf85316ac8201c697ac3af2bd9391d47ce496741 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:14:32 -0500 Subject: [PATCH 38/52] =?UTF-8?q?=F0=9F=91=B7=20Prerelease=20tag=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 1a5cc2f..d12710c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -39,6 +39,7 @@ jobs: env: IMAGE_NAME: ${{ needs.image-details.outputs.base-name }} IMAGE_URL: ${{ needs.image-details.outputs.base-url }} + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_DIR: build/standard steps: @@ -96,9 +97,9 @@ jobs: attestations: write id-token: write env: - # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-plugins IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-plugins + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_DIR: build/plugins steps: @@ -154,9 +155,9 @@ jobs: attestations: write id-token: write env: - # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_DIR: build/arm-none-eabi steps: @@ -212,9 +213,9 @@ jobs: attestations: write id-token: write env: - # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi-plugins IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins + # Image variant name is drawn from final `--dir` entry in file generation command line IMAGE_DIR: build/arm-none-eabi-plugins steps: @@ -268,10 +269,16 @@ jobs: contents: write steps: + # Capture the SHA string + - name: Git commit short SHA as environment variable + shell: bash + run: | + echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - uses: ncipollo/release-action@v1 with: prerelease: true allowUpdates: true - tag: ${{ github.ref }} + tag: ${{ env.SHA_SHORT }} artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" From ee032468217464378417990bf6b9ac24e777bcbf Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:21:16 -0500 Subject: [PATCH 39/52] =?UTF-8?q?=F0=9F=93=9D=20Fixed=20typo=20&=20shorten?= =?UTF-8?q?ed=20wording?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/base/templates/welcome.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/base/templates/welcome.erb b/build/base/templates/welcome.erb index fefca8b..c6c7a7e 100644 --- a/build/base/templates/welcome.erb +++ b/build/base/templates/welcome.erb @@ -5,8 +5,8 @@ echo " This container includes:" <%# INSERT CONTENTS LIST -%> <% @contents.each {|item|%><%= "if [[ \"$CONTAINER_PLATFORM\" == #{item['platform']} ]]; then echo \" * #{item['entry']}\"; fi\n"%><% } -%> echo "\e[0m" -echo " NOTICE: Container user \`$(whoami)\` lacks root priveleges as a security best practice." -echo " This limits installing software and more. See Docker Hub page for container security docs and options." +echo " NOTICE: Container user \`$(whoami)\` lacks root privileges as a security best practice." +echo " This limits installing software and more. See Docker Hub page for security docs and options." echo "\e[33m" echo " To get started, enter \`ceedling help\` at the command line..." echo "\e[0m" From 4c0e0719792f7caf846202ee01ae3cb3937a2b19 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:22:27 -0500 Subject: [PATCH 40/52] =?UTF-8?q?=F0=9F=91=B7=20Better=20job=20naming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index d12710c..cc6d03c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -262,7 +262,7 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - dockerfiles-prerelease: + artifacts-prerelease: runs-on: ubuntu-latest needs: [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins] permissions: From 6d3b77e947b057cd8158cd4830e843ff55801281 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:25:18 -0500 Subject: [PATCH 41/52] =?UTF-8?q?=F0=9F=91=B7=20Migrated=20dev=20Github=20?= =?UTF-8?q?Actions=20to=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 106 +++++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98daba6..5331bc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,13 +35,27 @@ jobs: id-token: write env: IMAGE_NAME: ${{ needs.image-details.outputs.base-name }} - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }} + # Image variant name is drawn from final `--dir` entry in file generation command line + IMAGE_DIR: build/standard steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + + - name: 'Run file generation' + id: file-gen + run: bash build.sh --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }} + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -61,12 +75,16 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/standard/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max madsciencelab-plugins: runs-on: ubuntu-latest @@ -77,16 +95,27 @@ jobs: attestations: write id-token: write env: - VARIANT: 'plugins' - # Cannot reference VARIANT as it does not exist yet IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-plugins - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-plugins + # Image variant name is drawn from final `--dir` entry in file generation command line + IMAGE_DIR: build/plugins steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + + - name: 'Run file generation' + run: bash build.sh --dir build/standard --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }} + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -105,12 +134,16 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/${{ env.VARIANT }}/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max madsciencelab-arm-none-eabi: runs-on: ubuntu-latest @@ -121,16 +154,27 @@ jobs: attestations: write id-token: write env: - VARIANT: 'arm-none-eabi' - # Cannot reference VARIANT as it does not exist yet IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi + # Image variant name is drawn from final `--dir` entry in file generation command line + IMAGE_DIR: build/arm-none-eabi steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + + - name: 'Run file generation' + run: bash build.sh --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }} + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -149,12 +193,16 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/${{ env.VARIANT }}/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest @@ -165,16 +213,27 @@ jobs: attestations: write id-token: write env: - VARIANT: 'arm-none-eabi-plugins' - # Cannot reference VARIANT as it does not exist yet IMAGE_NAME: ${{ needs.image-details.outputs.base-name }}-arm-none-eabi-plugins - # Cannot reference IMAGE_NAME as it does not exist yet IMAGE_URL: ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins + # Image variant name is drawn from final `--dir` entry in file generation command line + IMAGE_DIR: build/arm-none-eabi-plugins steps: + - name: 'Set up Ruby for generation tool' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + - name: 'Install file generation Ruby dependencies' + run: bundle install + + - name: 'Run file generation' + run: bash build.sh --dir build/arm-none-eabi --dir build/plugins --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }} + - name: 'Set up QEMU' uses: docker/setup-qemu-action@v3 @@ -193,10 +252,29 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - file: build/${{ env.VARIANT }}/docker/Dockerfile + context: . + file: ${{ env.IMAGE_DIR }}/docker/Dockerfile build-args: | CONTAINER_VERSION=${{ github.ref_name }} IMAGE_NAME=${{ env.IMAGE_NAME }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest + # Connect Docker driver to GitHub Action cache service + cache-from: type=gha + cache-to: type=gha,mode=max + + artifacts-release: + runs-on: ubuntu-latest + needs: [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins] + permissions: + contents: write + + steps: + - uses: ncipollo/release-action@v1 + with: + # Defaults to using tag name. + # This workflow is only triggered by tags. + prerelease: false + allowUpdates: true + artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" From e9aa985fbc3d832dcbea608707f10491a303b4db Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:25:37 -0500 Subject: [PATCH 42/52] =?UTF-8?q?=F0=9F=91=B7=20Yet=20another=20prerelease?= =?UTF-8?q?=20naming=20attempt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index cc6d03c..263123f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -279,6 +279,6 @@ jobs: with: prerelease: true allowUpdates: true - tag: ${{ env.SHA_SHORT }} + name: ${{ env.SHA_SHORT }} artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" From de4a3f66115e57311efc63ee1f52c2590e678718 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:32:08 -0500 Subject: [PATCH 43/52] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20shell=20script=20c?= =?UTF-8?q?ompare=20operator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/Dockerfile-user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/plugins/Dockerfile-user b/build/plugins/Dockerfile-user index 18f02ef..a9580d7 100644 --- a/build/plugins/Dockerfile-user +++ b/build/plugins/Dockerfile-user @@ -1,7 +1,7 @@ # Install `reportgenerator` (for `gcov` plugin) # Only available in AMD64 containers -RUN if [ "$TARGETPLATFORM" == "linux/amd64" ]; then set -ex \ +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then set -ex \ # Install the dotnet tool as global (which means global for the current user vs. a local directory) && dotnet tool install --global dotnet-reportgenerator-globaltool \ # Modify the PATH so the new tool is findable From 76ad975750aee0e79ebb6f4d0846ef865939c4d3 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 16:36:51 -0500 Subject: [PATCH 44/52] =?UTF-8?q?=F0=9F=91=B7=20Yet=20another=20prerelease?= =?UTF-8?q?=20tagging=20attempt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 263123f..31e9650 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -279,6 +279,8 @@ jobs: with: prerelease: true allowUpdates: true - name: ${{ env.SHA_SHORT }} + commit: ${{ github.sha }} + tag: ${{ env.SHA_SHORT }} + name: Prerelease-${{ env.SHA_SHORT }} artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" From 5d2214d43627947c9ce5bce8e88ae40eefbab342 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 21:04:14 -0500 Subject: [PATCH 45/52] =?UTF-8?q?=F0=9F=91=B7=20Jobs=20artifact=20handling?= =?UTF-8?q?=20+=20release=20action=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 53 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 31e9650..1b85498 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -88,6 +88,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + madsciencelab-plugins: runs-on: ubuntu-latest needs: [image-details] @@ -146,6 +155,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + madsciencelab-arm-none-eabi: runs-on: ubuntu-latest needs: [image-details] @@ -204,6 +222,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest needs: [image-details] @@ -262,15 +289,35 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + artifacts-prerelease: runs-on: ubuntu-latest - needs: [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins] + needs: + - madsciencelab + - madsciencelab-plugins + - madsciencelab-arm-none-eabi + - madsciencelab-arm-none-eabi-plugins permissions: contents: write steps: + # Get the repo so we have info for generating release details + - name: 'Checkout GitHub Action' + uses: actions/checkout@v4 + + # Download all artifacts from the 4 Docker image builds + - uses: actions/download-artifact@v4 + # Capture the SHA string - - name: Git commit short SHA as environment variable + - name: 'Git commit short SHA as environment variable' shell: bash run: | echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV @@ -282,5 +329,5 @@ jobs: commit: ${{ github.sha }} tag: ${{ env.SHA_SHORT }} name: Prerelease-${{ env.SHA_SHORT }} - artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" + artifacts: "**/Dockerfile,**/welcome" From b5e5028651c98ab77e32a71a00e0aa5c82b33522 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 22:20:33 -0500 Subject: [PATCH 46/52] =?UTF-8?q?=F0=9F=91=B7=20Artifacts=20download=20fix?= =?UTF-8?q?=20experiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5331bc2..4f8d9c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,6 +86,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + madsciencelab-plugins: runs-on: ubuntu-latest needs: [image-details] @@ -145,6 +154,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + madsciencelab-arm-none-eabi: runs-on: ubuntu-latest needs: [image-details] @@ -204,6 +222,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + madsciencelab-arm-none-eabi-plugins: runs-on: ubuntu-latest needs: [image-details] @@ -263,18 +290,46 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Upload the generated files as artifacts + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.IMAGE_NAME }} + path: | + ${{ env.IMAGE_DIR }}/docker/Dockerfile + ${{ env.IMAGE_DIR }}/assets/shell/welcome + if-no-files-found: error + artifacts-release: runs-on: ubuntu-latest - needs: [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins] + needs: + - madsciencelab + - madsciencelab-plugins + - madsciencelab-arm-none-eabi + - madsciencelab-arm-none-eabi-plugins permissions: contents: write steps: + # Get the repo so we have info for generating release details + - name: 'Checkout GitHub Action' + uses: actions/checkout@v4 + + # Download all artifacts from the 4 Docker image builds + - uses: actions/download-artifact@v4 + with: + path: artifacts + + # Capture the SHA string + - name: 'Git commit short SHA as environment variable' + shell: bash + run: | + echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - uses: ncipollo/release-action@v1 with: # Defaults to using tag name. # This workflow is only triggered by tags. prerelease: false allowUpdates: true - artifacts: "build/*/docker/Dockerfile,build/*/assets/shell/welcome" + artifacts: "artifacts/**/Dockerfile,artifacts/**/welcome" From 3cb48dffd212fd12cfed11372ad1b7ed667c7ae2 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 22:51:16 -0500 Subject: [PATCH 47/52] =?UTF-8?q?=F0=9F=91=B7=20Github=20Action=20artifact?= =?UTF-8?q?=20download=20bug=20workaround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f8d9c6..cc3b67e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -317,6 +317,10 @@ jobs: # Download all artifacts from the 4 Docker image builds - uses: actions/download-artifact@v4 with: + # `pattern:` is a workaround to an artifact upload incompatibility with docker/build-push-action@v6 + # Otherwise, without `pattern:` the default of all artifacts would occur just as with this glob + # https://github.com/docker/build-push-action/issues/1167 + pattern: "madsciencelab*" path: artifacts # Capture the SHA string From 82e07409ca11c056eb280ea84a2073fef957db68 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 23 Jan 2025 22:52:42 -0500 Subject: [PATCH 48/52] =?UTF-8?q?=F0=9F=91=B7=20Github=20Action=20artifact?= =?UTF-8?q?=20download=20bug=20workaround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 1b85498..12ab4d7 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -315,6 +315,12 @@ jobs: # Download all artifacts from the 4 Docker image builds - uses: actions/download-artifact@v4 + with: + # `pattern:` is a workaround to an artifact upload incompatibility with docker/build-push-action@v6 + # Otherwise, without `pattern:` the default of all artifacts would occur just as with this glob + # https://github.com/docker/build-push-action/issues/1167 + pattern: "madsciencelab*" + path: artifacts # Capture the SHA string - name: 'Git commit short SHA as environment variable' @@ -329,5 +335,4 @@ jobs: commit: ${{ github.sha }} tag: ${{ env.SHA_SHORT }} name: Prerelease-${{ env.SHA_SHORT }} - artifacts: "**/Dockerfile,**/welcome" - + artifacts: "artifacts/**/Dockerfile,artifacts/**/welcome" From e159949f0c722acebdc14ae3eade2a6c8545d7bb Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Fri, 24 Jan 2025 09:47:23 -0500 Subject: [PATCH 49/52] =?UTF-8?q?=F0=9F=91=B7=20Improved=20artifact=20gene?= =?UTF-8?q?ration=20+=20release=20body?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 46 ++++++++++++++++++++++-------------- .github/workflows/release.md | 14 +++++++++++ 2 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/release.md diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 12ab4d7..c2cfc21 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -88,13 +88,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error madsciencelab-plugins: @@ -155,13 +157,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error madsciencelab-arm-none-eabi: @@ -222,13 +226,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error madsciencelab-arm-none-eabi-plugins: @@ -289,15 +295,18 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error + # After all Docker image builds, collect results and publish a pre-release artifacts-prerelease: runs-on: ubuntu-latest needs: @@ -317,7 +326,7 @@ jobs: - uses: actions/download-artifact@v4 with: # `pattern:` is a workaround to an artifact upload incompatibility with docker/build-push-action@v6 - # Otherwise, without `pattern:` the default of all artifacts would occur just as with this glob + # Otherwise, apart from this bug requiring `pattern:` the default of all artifacts would occur without any intervention # https://github.com/docker/build-push-action/issues/1167 pattern: "madsciencelab*" path: artifacts @@ -332,7 +341,8 @@ jobs: with: prerelease: true allowUpdates: true + bodyFile: .github/workflows/release.md commit: ${{ github.sha }} tag: ${{ env.SHA_SHORT }} - name: Prerelease-${{ env.SHA_SHORT }} + name: Dev Build Prerelease-${{ env.SHA_SHORT }} artifacts: "artifacts/**/Dockerfile,artifacts/**/welcome" diff --git a/.github/workflows/release.md b/.github/workflows/release.md new file mode 100644 index 0000000..3b6e01b --- /dev/null +++ b/.github/workflows/release.md @@ -0,0 +1,14 @@ +# MadScienceLab Docker Images Builds + +Each build produces multiple variants of the `madsciencelab` Docker images containing Ceedling and its supporting frameworks as well as various utilities and compilation toolchains. Each image targets multiple host platforms. + +A dev build of this repository in a Github Action generates files and validates the Docker image build. A release build also pushes the resulting Docker images to Docker hub. + +See the [Docker Hub repository](https://hub.docker.com/r/throwtheswitch) for official releases of the resulting Docker images and their documentation. + +# Contents + +* A zip archive for each Docker image containing the generated Dockerfile and any other generated file artifacts used to build the image in Docker Hub. +* A zip archive of the entire project including the static assets used to build the Docker images. + +See this reository’s documentation for instructions on how to use the tools of this repository and how to build these Docker images. \ No newline at end of file From 336dc0d397c9e386ae6b32a6d5fc400c3c21bd87 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Fri, 24 Jan 2025 09:58:08 -0500 Subject: [PATCH 50/52] =?UTF-8?q?=F0=9F=91=B7=20More=20build=20&=20release?= =?UTF-8?q?=20upload=20tweaks=20&=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- .github/workflows/release.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index c2cfc21..6789b64 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -345,4 +345,4 @@ jobs: commit: ${{ github.sha }} tag: ${{ env.SHA_SHORT }} name: Dev Build Prerelease-${{ env.SHA_SHORT }} - artifacts: "artifacts/**/Dockerfile,artifacts/**/welcome" + artifacts: "artifacts/*.zip" diff --git a/.github/workflows/release.md b/.github/workflows/release.md index 3b6e01b..a5625db 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -1,4 +1,4 @@ -# MadScienceLab Docker Images Builds +## MadScienceLab Docker Images Builds Each build produces multiple variants of the `madsciencelab` Docker images containing Ceedling and its supporting frameworks as well as various utilities and compilation toolchains. Each image targets multiple host platforms. @@ -6,7 +6,7 @@ A dev build of this repository in a Github Action generates files and validates See the [Docker Hub repository](https://hub.docker.com/r/throwtheswitch) for official releases of the resulting Docker images and their documentation. -# Contents +## Contents * A zip archive for each Docker image containing the generated Dockerfile and any other generated file artifacts used to build the image in Docker Hub. * A zip archive of the entire project including the static assets used to build the Docker images. From 849839735d2421e63a0ea4ff9f0c1bc4fc63e1af Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Fri, 24 Jan 2025 10:13:49 -0500 Subject: [PATCH 51/52] =?UTF-8?q?=F0=9F=91=B7=20Release=20artifact=20glob?= =?UTF-8?q?=20path=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 6789b64..08c471c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -345,4 +345,4 @@ jobs: commit: ${{ github.sha }} tag: ${{ env.SHA_SHORT }} name: Dev Build Prerelease-${{ env.SHA_SHORT }} - artifacts: "artifacts/*.zip" + artifacts: "artifacts/*/*.zip" From 82d9fd46ebcb2bad1f0202b87dd1c2164aedede9 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Fri, 24 Jan 2025 11:21:35 -0500 Subject: [PATCH 52/52] =?UTF-8?q?=F0=9F=91=B7=20Final=20Github=20Action=20?= =?UTF-8?q?tweaks=20&=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev.yml | 4 +-- .github/workflows/release.md | 31 ++++++++++++++++++++--- .github/workflows/release.yml | 47 +++++++++++++++++++++-------------- 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 08c471c..7a2b84c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -307,7 +307,7 @@ jobs: if-no-files-found: error # After all Docker image builds, collect results and publish a pre-release - artifacts-prerelease: + artifacts-dev-build: runs-on: ubuntu-latest needs: - madsciencelab @@ -344,5 +344,5 @@ jobs: bodyFile: .github/workflows/release.md commit: ${{ github.sha }} tag: ${{ env.SHA_SHORT }} - name: Dev Build Prerelease-${{ env.SHA_SHORT }} + name: Dev Build ${{ env.SHA_SHORT }} artifacts: "artifacts/*/*.zip" diff --git a/.github/workflows/release.md b/.github/workflows/release.md index a5625db..03ddb45 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -1,14 +1,37 @@ ## MadScienceLab Docker Images Builds -Each build produces multiple variants of the `madsciencelab` Docker images containing Ceedling and its supporting frameworks as well as various utilities and compilation toolchains. Each image targets multiple host platforms. +Each build produces multiple variants of the `throwtheswitch/madsciencelab` Docker images containing Ceedling and its supporting frameworks as well as various utilities and compilation toolchains. Each image built from this repository targets multiple runtime host platforms. -A dev build of this repository in a Github Action generates files and validates the Docker image build. A release build also pushes the resulting Docker images to Docker hub. +Build types (via Github Actions): + +1. A dev build of this repository generates files and validates the Docker image build. +1. A release build adds to (1) by also pushing the resulting Docker images to Docker Hub. See the [Docker Hub repository](https://hub.docker.com/r/throwtheswitch) for official releases of the resulting Docker images and their documentation. -## Contents +## Build Artifacts * A zip archive for each Docker image containing the generated Dockerfile and any other generated file artifacts used to build the image in Docker Hub. * A zip archive of the entire project including the static assets used to build the Docker images. -See this reository’s documentation for instructions on how to use the tools of this repository and how to build these Docker images. \ No newline at end of file +See this reository’s documentation for instructions on how to use the tools of this repository and how to manually build the Docker images this repository maintains. + +## Changelog + +### Added + +* ... + +### Fixed + +* ... + +### Changed + +* ... + +### Removed + +* ... + + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc3b67e..b2489e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,13 +86,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error madsciencelab-plugins: @@ -154,13 +156,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error madsciencelab-arm-none-eabi: @@ -222,13 +226,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error madsciencelab-arm-none-eabi-plugins: @@ -290,13 +296,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - # Upload the generated files as artifacts + # Zip generated files as a single artifact + - name: 'Archive ${{ env.IMAGE_NAME }} generated files as a single artifact' + run: zip -j ${{ env.IMAGE_NAME }}.zip ${{ env.IMAGE_DIR }}/docker/Dockerfile ${{ env.IMAGE_DIR }}/assets/shell/welcome + + # Upload the zip artifact - uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }} - path: | - ${{ env.IMAGE_DIR }}/docker/Dockerfile - ${{ env.IMAGE_DIR }}/assets/shell/welcome + path: ${{ env.IMAGE_NAME }}.zip if-no-files-found: error artifacts-release: @@ -318,7 +326,7 @@ jobs: - uses: actions/download-artifact@v4 with: # `pattern:` is a workaround to an artifact upload incompatibility with docker/build-push-action@v6 - # Otherwise, without `pattern:` the default of all artifacts would occur just as with this glob + # Otherwise, apart from this bug requiring `pattern:` the default of all artifacts would occur without any intervention # https://github.com/docker/build-push-action/issues/1167 pattern: "madsciencelab*" path: artifacts @@ -331,9 +339,10 @@ jobs: - uses: ncipollo/release-action@v1 with: - # Defaults to using tag name. + # Defaults to using commit tag for `tag:`. # This workflow is only triggered by tags. prerelease: false allowUpdates: true - artifacts: "artifacts/**/Dockerfile,artifacts/**/welcome" + name: Release ${{ github.ref_name }} + artifacts: "artifacts/*/*.zip"