Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to python-tools-scripts #47

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 26 additions & 22 deletions .github/workflows/.container.template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- '<{ repository_path }>/*'

env:
COLUMNS: 190
PATH_IN_REPO: <{ repository_path }>


Expand Down Expand Up @@ -45,23 +46,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 +84,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 +136,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 +173,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 +223,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
48 changes: 26 additions & 22 deletions .github/workflows/almalinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- 'mirrors/almalinux/*'

env:
COLUMNS: 190
PATH_IN_REPO: mirrors/almalinux


Expand Down Expand Up @@ -45,23 +46,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 +84,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 +136,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 +173,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 +223,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
48 changes: 26 additions & 22 deletions .github/workflows/amazonlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- 'mirrors/amazonlinux/*'

env:
COLUMNS: 190
PATH_IN_REPO: mirrors/amazonlinux


Expand Down Expand Up @@ -45,23 +46,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 +84,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 +136,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 +173,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 +223,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
48 changes: 26 additions & 22 deletions .github/workflows/archlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- 'mirrors/archlinux/*'

env:
COLUMNS: 190
PATH_IN_REPO: mirrors/archlinux


Expand Down Expand Up @@ -45,23 +46,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 +84,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 +136,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 +173,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 +223,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
Loading