From 5a0a2fb8084e9fb08b09a9bd09adf8708387a311 Mon Sep 17 00:00:00 2001 From: William Douglas Date: Fri, 14 Jun 2024 14:46:48 -0700 Subject: [PATCH] Treat CI images as differently Create the CI images in different job units to work around image size issues. --- .github/workflows/release.yaml | 38 ++++++++++++++++++++++++++++++++++ build-and-push-images.sh | 12 +++++++---- clr-installer-ci/Dockerfile | 3 ++- mixer-ci/Dockerfile | 4 ++-- 4 files changed, 50 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 749c7c9..a694e01 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,44 @@ env: GITHUB_TOKEN: ${{ github.token }} jobs: + clr-installer-ci: + if: (github.event_name == 'create' && github.event.ref_type == 'tag') + name: Release + strategy: + fail-fast: false + runs-on: ubuntu-latest + steps: + - name: Delete unused tools folder + run: rm -rf /opt/hostedtoolcache + - name: Code Checkout + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push + run: ./build-and-push-images.sh ${{ github.event.ref }} clr-installer-ci + mixer-ci: + if: (github.event_name == 'create' && github.event.ref_type == 'tag') + name: Release + strategy: + fail-fast: false + runs-on: ubuntu-latest + steps: + - name: Delete unused tools folder + run: rm -rf /opt/hostedtoolcache + - name: Code Checkout + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push + run: ./build-and-push-images.sh ${{ github.event.ref }} mixer-ci release: if: (github.event_name == 'create' && github.event.ref_type == 'tag') name: Release diff --git a/build-and-push-images.sh b/build-and-push-images.sh index 12504e3..ec0e194 100755 --- a/build-and-push-images.sh +++ b/build-and-push-images.sh @@ -26,8 +26,7 @@ build_and_push_image() { main() { local ver="$1" build_and_push_image os-core "${ver}" - build_and_push_image clr-installer-ci "${ver}" - # httpd is used by cgit so it must be pushed first + # httpd is used by cgit so it must be pushed first build_and_push_image httpd "${ver}" build_and_push_image cgit "${ver}" build_and_push_image golang "${ver}" @@ -35,7 +34,6 @@ main() { build_and_push_image iperf "${ver}" build_and_push_image mariadb "${ver}" build_and_push_image memcached "${ver}" - build_and_push_image mixer-ci "${ver}" build_and_push_image nginx "${ver}" build_and_push_image node "${ver}" build_and_push_image numpy-mp "${ver}" @@ -51,4 +49,10 @@ main() { build_and_push_image tesseract-ocr "${ver}" } -main $1 +if [ "$2" == "clr-installer-ci" ]; then + build_and_push_image clr-installer-ci "$1" +elif [ "$2" == "mixer-ci" ]; then + build_and_push_image mixer-ci "$1" +else + main $1 +fi diff --git a/clr-installer-ci/Dockerfile b/clr-installer-ci/Dockerfile index 881d583..db7a03f 100644 --- a/clr-installer-ci/Dockerfile +++ b/clr-installer-ci/Dockerfile @@ -1,10 +1,11 @@ FROM clearlinux:latest +ARG clear_ver # Configure Go ENV GOPATH="/go" PATH="/go/bin:${PATH}" # Update and add bundles -RUN swupd update && \ +RUN swupd update -V $clear_ver && \ swupd bundle-add sysadmin-basic storage-utils network-basic go-basic-dev devpkg-gtk3 clr-installer-gui && \ swupd clean && \ # Install the Go Linters diff --git a/mixer-ci/Dockerfile b/mixer-ci/Dockerfile index 424f4fb..c09fc2a 100644 --- a/mixer-ci/Dockerfile +++ b/mixer-ci/Dockerfile @@ -1,15 +1,15 @@ FROM clearlinux:latest +ARG clear_ver # Configure Go ENV GOPATH /home/clr/go ENV PATH="/home/clr/go/bin:${PATH}" # Update and add bundles -RUN swupd update && \ +RUN swupd update -V $clear_ver && \ swupd bundle-add mixer go-basic c-basic os-core-update-dev sudo && \ useradd -G wheelnopw clr && \ mkdir -p /run/lock USER clr RUN git config --global user.email "travis@example.com" && \ git config --global user.name "Travis CI" -