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 <[email protected]>
  • Loading branch information
s0undt3ch committed Nov 24, 2023
1 parent d536219 commit 815023d
Show file tree
Hide file tree
Showing 41 changed files with 1,181 additions and 1,096 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/.container.template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,20 @@ 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: Show tools version
run: |
tools --debug --version

- 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 +83,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 +135,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,6 +172,23 @@ jobs:
statuses: read

steps:

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

- 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 tools version
run: |
tools --debug --version

- name: Download digests
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -217,10 +222,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- 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
47 changes: 25 additions & 22 deletions .github/workflows/almalinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,20 @@ 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: Show tools version
run: |
tools --debug --version
- 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 +83,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 +135,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,6 +172,23 @@ jobs:
statuses: read

steps:

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

- 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 tools version
run: |
tools --debug --version
- name: Download digests
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -217,10 +222,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- 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
47 changes: 25 additions & 22 deletions .github/workflows/amazonlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,20 @@ 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: Show tools version
run: |
tools --debug --version
- 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 +83,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 +135,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,6 +172,23 @@ jobs:
statuses: read

steps:

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

- 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 tools version
run: |
tools --debug --version
- name: Download digests
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -217,10 +222,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- 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
47 changes: 25 additions & 22 deletions .github/workflows/archlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,20 @@ 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: Show tools version
run: |
tools --debug --version
- 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 +83,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 +135,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,6 +172,23 @@ jobs:
statuses: read

steps:

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

- 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 tools version
run: |
tools --debug --version
- name: Download digests
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -217,10 +222,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- 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 815023d

Please sign in to comment.