-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
63 lines (56 loc) · 2.12 KB
/
Copy pathaction.yaml
File metadata and controls
63 lines (56 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
name: Run OpenShift Preflight
description: |
This action downloads the OpenShift preflight tool, runs it, and then reports
if the check passed.
inputs:
preflight-version:
default: latest
description: The version of the OpenShift preflight tool.
image-index-uri:
description: |
The image index URI (eg. oci.stackable.tech/sdp/kafka:3.4.1-stackable0.0.0-dev) of the image
to be checked.
image-architecture:
description: The image architecture to be checked.
runs:
using: composite
steps:
- name: Download the OpenShift preflight tool
env:
PREFLIGHT_VERSION: ${{ inputs.preflight-version }}
shell: bash
run: |
set -euo pipefail
[ -n "${RUNNER_DEBUG+set}" ] && set -x
ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")
SYSTEM=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_platform.sh")
if [ "$PREFLIGHT_VERSION" == "latest" ]; then
curl -fsSL -o /tmp/openshift-preflight "https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/latest/download/preflight-${SYSTEM}-${ARCH}"
else
curl -fsSL -o /tmp/openshift-preflight "https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/${PREFLIGHT_VERSION}/preflight-${SYSTEM}-${ARCH}"
fi
sudo install -m 755 -t /usr/local/bin /tmp/openshift-preflight
- name: Check Container Image
env:
IMAGE_ARCHITECTURE: ${{ inputs.image-architecture }}
IMAGE_INDEX_URI: ${{ inputs.image-index-uri }}
shell: bash
run: |
set -euo pipefail
[ -n "${RUNNER_DEBUG+set}" ] && set -x
openshift-preflight check container "$IMAGE_INDEX_URI" --platform "$IMAGE_ARCHITECTURE" > preflight.out
- name: Report Result
shell: bash
run: |
set -euo pipefail
[ -n "${RUNNER_DEBUG+set}" ] && set -x
if [ "$(jq -r .passed < preflight.out)" == true ]; then
echo "Checks Passed"
exit 0
else
echo "Checks failed"
cat preflight.out
cat preflight.log
exit 1
fi