Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Validate rpm and runner #279

Merged
merged 1 commit into from
Jan 16, 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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- release

env:
EXTRA_OPTS: --jobs=4 --platform linux/amd64,linux/arm64
EXTRA_OPTS: --jobs=4 --platform=linux/amd64,linux/arm64
EXPECTED_IMAGES: 2

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:

env:
# We use this option only on release pipeline due to the heavy cost
# EXTRA_OPTS: --platform linux/amd64,linux/arm64
EXPECTED_IMAGES: 1
EXTRA_OPTS: --platform=linux/amd64,linux/arm64
EXPECTED_IMAGES: 2

steps:
- name: Grab the source from Git
Expand Down
3 changes: 1 addition & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ tasks:
- ansible-galaxy collection install -r _build/requirements.yml -p collections
- podman manifest exists {{.CNT_NAME_TAG}} && podman manifest rm {{.CNT_NAME_TAG}} || true
- podman image exists {{.CNT_NAME_TAG}} && podman image rm {{.CNT_NAME_TAG}} || true
- podman buildx build ${EXTRA_OPTS:-} --load {{.CNT_ROOT}} --manifest {{.CNT_NAME_TAG}}
- podman buildx build ${EXTRA_OPTS:---platform=linux/amd64,linux/arm64} --load {{.CNT_ROOT}} --manifest {{.CNT_NAME_TAG}}
# running manifest exists is mandatory as this fails if no manifest is
# created locally. If this is skipped the inspect might pull the last
# published manifest instead of using the local one.
- podman manifest exists {{.CNT_NAME_TAG}}
# Fail if the manifest does not contain exactly two images
- podman manifest inspect {{.CNT_NAME_TAG}} | jq '.manifests | length' | grep -q "${EXPECTED_IMAGES:-2}"
# Validate image
- ./_build/validate {{.CNT_NAME_TAG}}
- touch .task/.{{.CNT_NAME}}.done
Expand Down
10 changes: 10 additions & 0 deletions _build/validate
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@ podman run -i --user="$(id -u)" -e EP_DEBUG=1 "$CNT" uname -a
podman run -i --user="$(id -u)" "$CNT" uname -a
podman run -i --user="$(id -u)" "$CNT" bash -c 'set | grep PATH'
podman run -i --user="$(id -u)" "$CNT" command -v ansible-lint

# ensure that git is configured to consider any directory safe:
podman run -i --user="$(id -u)" "$CNT" bash -c '[[ $(git config safe.directory) == "/" ]]'

# Ensure some packages required are present
# navigator requires the rpm db be intact as it runs rpm -qa
podman run -i --user="$(id -u)" "$CNT" bash -c 'rpm -qa | grep python'
# ansible-runner is needed in all execution environment images
podman run -i --user="$(id -u)" "$CNT" ansible-runner --version

# ensure that the image is build for both supported architectures and the manifest is correct
podman manifest inspect "$CNT" | jq '.manifests | length' | grep -q "${EXPECTED_IMAGES:-2}"