Skip to content

Commit

Permalink
Parametrize arches
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Nov 24, 2023
1 parent a3925d0 commit f60a744
Show file tree
Hide file tree
Showing 31 changed files with 247 additions and 400 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/.container.template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,27 @@ jobs:
run: |
python -m pip install -r requirements.txt

<%- if multiarch %>

- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

<%- endif %>

- name: "Generate Matrix Data"
id: set-matrix
run: |
<%- if multiarch %>
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=<{ exclude_platforms }>
<%- else %>
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
<%- endif %>

mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}<%- if multiarch %>(${{ matrix.dockerinfo.arch }})<%- endif %>"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,19 +129,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"

<%- if multiarch %>

- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt

- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=<{ exclude_platforms }> source-container-inspect.txt
<%- endif %>

- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -143,7 +142,7 @@ jobs:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
<%- if multiarch %>
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
<%- endif %>
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/almalinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
20 changes: 7 additions & 13 deletions .github/workflows/amazonlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
20 changes: 7 additions & 13 deletions .github/workflows/archlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
20 changes: 7 additions & 13 deletions .github/workflows/busybox-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
20 changes: 7 additions & 13 deletions .github/workflows/centos-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
20 changes: 7 additions & 13 deletions .github/workflows/centos-stream-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
20 changes: 7 additions & 13 deletions .github/workflows/consul-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: "Docker BuildX"
id: buildx
uses: docker/setup-buildx-action@v2

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch --exclude-arches=linux/s390x,linux/mips64le
mirror-image:
runs-on: ubuntu-latest
needs: matrix-generator
name: "${{ matrix.dockerinfo.name }}"
name: "${{ matrix.dockerinfo.name }}(${{ matrix.dockerinfo.arch }})"
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -117,16 +121,6 @@ jobs:
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Inspect Source Image
run: |
set -o pipefail
docker buildx imagetools inspect ${{ matrix.dockerinfo.source_container }} | tee -a source-container-inspect.txt
- name: Define Build Platforms
id: define-platforms
run: |
inv containers.platforms --exclude=linux/s390x,linux/mips64le source-container-inspect.txt
- name: "Log into GitHub Container Registry"
uses: docker/login-action@v2
with:
Expand All @@ -139,7 +133,7 @@ jobs:
with:
file: ${{ matrix.dockerinfo.file }}
context: ${{ env.PATH_IN_REPO }}
platforms: ${{ steps.define-platforms.outputs.platforms }}
platforms: ${{ matrix.dockerinfo.arch }}
push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}
Loading

0 comments on commit f60a744

Please sign in to comment.