-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RELEASE-1310): add update-cr-status to push-disk-images
Signed-off-by: Maor Friedman <mafriedm@redhat.com>
- Loading branch information
Showing
12 changed files
with
182 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
tasks/push-disk-images/tests/test-push-disk-images-results.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: test-push-disk-images-results | ||
spec: | ||
description: | | ||
Run the push-disk-images task with and verify the proper file names are reported as task results | ||
workspaces: | ||
- name: tests-workspace | ||
tasks: | ||
- name: setup | ||
taskSpec: | ||
steps: | ||
- name: setup | ||
image: quay.io/konflux-ci/release-service-utils:6a7ca9ba0ddd70404fe2267551409925cf513132 | ||
script: | | ||
#!/usr/bin/env bash | ||
set -eux | ||
mkdir "$(workspaces.data.path)/results" | ||
cat > "$(workspaces.data.path)/snapshot_spec.json" << EOF | ||
{ | ||
"application": "nvidia-aws-disk-image-1-3", | ||
"artifacts": {}, | ||
"components": [ | ||
{ | ||
"containerImage": "quay.io/redhat-user-workloads/rhel-ai-tenant/nvidia-aws-disk-image-1-3/nvidia-aws-disk-image-1-3@sha256:c866ff5e773045580c3f3025610c82c653685db9914712ed2713dfea8ec13e05", | ||
"name": "nvidia-aws-disk-image-1-3", | ||
"source": { | ||
"git": { | ||
"revision": "534fa8a78f4587ccca254eec71eab26677f29090", | ||
"url": "https://gitlab.com/redhat/rhel-ai/disk-images/nvidia-aws" | ||
} | ||
}, | ||
"contentGateway": { | ||
"filePrefix": "rhel-ai-nvidia-aws-1.3", | ||
"productCode": "RHELAI", | ||
"productName": "Binary_RL_Red Hat Enterprise Linux AI", | ||
"productVersionName": "1.3-staging" | ||
}, | ||
"staged": { | ||
"destination": "rhelai-1_DOT_3-for-rhel-9-x86_64-isos", | ||
"files": [ | ||
{ | ||
"filename": "rhel-ai-nvidia-aws-1.3-1732915588-x86_64.ami", | ||
"source": "disk.raw" | ||
} | ||
], | ||
"version": "1.3" | ||
} | ||
} | ||
] | ||
} | ||
EOF | ||
cat > "$(workspaces.data.path)/data.json" << EOF | ||
{ | ||
"contentGateway": { | ||
"productName": "Konflux test product", | ||
"productCode": "KTestProduct", | ||
"productVersionName": "KTestProduct 1", | ||
"components": [ | ||
{ | ||
"name": "test-component", | ||
"description": "Red Hat OpenShift Local Sandbox Test", | ||
"label": "Checksum File Sandbox Test" | ||
} | ||
] | ||
}, | ||
"cdn": { | ||
"env": "stage" | ||
} | ||
} | ||
EOF | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
- name: run-task | ||
taskRef: | ||
name: push-disk-images | ||
params: | ||
- name: snapshotPath | ||
value: "snapshot_spec.json" | ||
- name: dataPath | ||
value: "data.json" | ||
- name: pipelineRunUid | ||
value: $(context.pipelineRun.uid) | ||
- name: resultsDirPath | ||
value: results | ||
runAfter: | ||
- setup | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
- name: check-result | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
runAfter: | ||
- run-task | ||
taskSpec: | ||
workspaces: | ||
- name: data | ||
steps: | ||
- name: check-result | ||
image: quay.io/konflux-ci/release-service-utils:6a7ca9ba0ddd70404fe2267551409925cf513132 | ||
script: | | ||
#!/usr/bin/env bash | ||
set -ex | ||
results=$(cat "$(workspaces.data.path)/results/push-disk-images-results.json") | ||
# Check the results file | ||
expected="rhel-ai-nvidia-aws-1.3-1732915588-x86_64.ami" | ||
if [ "$(jq -r '.disk-image-files[]' <<< "$results")" != "$expected" ]; then | ||
echo "push-disk-images results do not contain expected file names" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters