Skip to content

Commit

Permalink
Switch to python-tools-scripts
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 d536219 commit 83f123f
Show file tree
Hide file tree
Showing 40 changed files with 969 additions and 1,096 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/.container.template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,16 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt

- name: "Docker QEMU"
uses: docker/setup-qemu-action@v3

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

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
tools ci matrix ${{ env.PATH_IN_REPO }}

build:
runs-on: ubuntu-latest
Expand All @@ -86,15 +79,6 @@ jobs:
- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt

- name: "Throttle concurrent pushes"
run: |
t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t"
Expand Down Expand Up @@ -147,7 +131,7 @@ jobs:
if: ${{ github.repository == 'saltstack/salt-ci-containers' && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }}
run: |
mkdir -p /tmp/digests
touch /tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ":" -f 2)
touch "/tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ':' -f 2)"
ls -lah /tmp/digests

- name: Upload digest
Expand Down Expand Up @@ -184,12 +168,25 @@ jobs:
statuses: read

steps:

- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }}
path: /tmp/digests

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt

- name: Show digests
run: |
tree -a /tmp/digests
Expand Down Expand Up @@ -218,9 +215,8 @@ jobs:

- name: Create manifest list and push
working-directory: /tmp/digests
run: | # shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)
run:
tools ci create-manifest-list-and-push ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} /tmp/digests

- name: Inspect image
run: |
Expand Down
40 changes: 18 additions & 22 deletions .github/workflows/almalinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,16 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: "Docker QEMU"
uses: docker/setup-qemu-action@v3

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

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
tools ci matrix ${{ env.PATH_IN_REPO }}
build:
runs-on: ubuntu-latest
Expand All @@ -86,15 +79,6 @@ jobs:
- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: "Throttle concurrent pushes"
run: |
t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t"
Expand Down Expand Up @@ -147,7 +131,7 @@ jobs:
if: ${{ github.repository == 'saltstack/salt-ci-containers' && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }}
run: |
mkdir -p /tmp/digests
touch /tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ":" -f 2)
touch "/tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ':' -f 2)"
ls -lah /tmp/digests
- name: Upload digest
Expand Down Expand Up @@ -184,12 +168,25 @@ jobs:
statuses: read

steps:

- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }}
path: /tmp/digests

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: Show digests
run: |
tree -a /tmp/digests
Expand Down Expand Up @@ -218,9 +215,8 @@ jobs:

- name: Create manifest list and push
working-directory: /tmp/digests
run: | # shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)
run:
tools ci create-manifest-list-and-push ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} /tmp/digests

- name: Inspect image
run: |
Expand Down
40 changes: 18 additions & 22 deletions .github/workflows/amazonlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,16 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: "Docker QEMU"
uses: docker/setup-qemu-action@v3

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

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
tools ci matrix ${{ env.PATH_IN_REPO }}
build:
runs-on: ubuntu-latest
Expand All @@ -86,15 +79,6 @@ jobs:
- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: "Throttle concurrent pushes"
run: |
t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t"
Expand Down Expand Up @@ -147,7 +131,7 @@ jobs:
if: ${{ github.repository == 'saltstack/salt-ci-containers' && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }}
run: |
mkdir -p /tmp/digests
touch /tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ":" -f 2)
touch "/tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ':' -f 2)"
ls -lah /tmp/digests
- name: Upload digest
Expand Down Expand Up @@ -184,12 +168,25 @@ jobs:
statuses: read

steps:

- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }}
path: /tmp/digests

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: Show digests
run: |
tree -a /tmp/digests
Expand Down Expand Up @@ -218,9 +215,8 @@ jobs:

- name: Create manifest list and push
working-directory: /tmp/digests
run: | # shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)
run:
tools ci create-manifest-list-and-push ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} /tmp/digests

- name: Inspect image
run: |
Expand Down
40 changes: 18 additions & 22 deletions .github/workflows/archlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,16 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: "Docker QEMU"
uses: docker/setup-qemu-action@v3

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

- name: "Generate Matrix Data"
id: set-matrix
run: |
inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}
tools ci matrix ${{ env.PATH_IN_REPO }}
build:
runs-on: ubuntu-latest
Expand All @@ -86,15 +79,6 @@ jobs:
- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: "Throttle concurrent pushes"
run: |
t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t"
Expand Down Expand Up @@ -147,7 +131,7 @@ jobs:
if: ${{ github.repository == 'saltstack/salt-ci-containers' && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }}
run: |
mkdir -p /tmp/digests
touch /tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ":" -f 2)
touch "/tmp/digests/$(echo ${{ steps.build.outputs.digest }} | cut -d ':' -f 2)"
ls -lah /tmp/digests
- name: Upload digest
Expand Down Expand Up @@ -184,12 +168,25 @@ jobs:
statuses: read

steps:

- name: "Fetching Repository Contents"
uses: actions/checkout@v4

- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }}
path: /tmp/digests

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Requirements
run: |
python -m pip install -r requirements.txt
- name: Show digests
run: |
tree -a /tmp/digests
Expand Down Expand Up @@ -218,9 +215,8 @@ jobs:

- name: Create manifest list and push
working-directory: /tmp/digests
run: | # shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)
run:
tools ci create-manifest-list-and-push ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} /tmp/digests

- name: Inspect image
run: |
Expand Down
Loading

0 comments on commit 83f123f

Please sign in to comment.