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

Use a var for the images file path in the RHTAP gather-deploy-images task #1240

Merged
Merged
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
7 changes: 4 additions & 3 deletions task/gather-deploy-images/0.1/gather-deploy-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ spec:
set -euo pipefail

IMAGE_PATH='.spec.template.spec.containers[0].image'
IMAGES_FILE='/tmp/all-images.txt'
component_name=$(yq .metadata.name application.yaml)

for env in "$@"; do
Expand All @@ -55,9 +56,9 @@ spec:
fi

printf "%s\n" "$image"
done | sort -u > /tmp/all-images.txt
done | sort -u > $IMAGES_FILE

if [ ! -s /tmp/all-images.txt ]; then
if [ ! -s $IMAGES_FILE ]; then
echo "No images to verify"
touch $(results.IMAGES_TO_VERIFY.path)
exit 0
Expand All @@ -66,7 +67,7 @@ spec:
# TODO: each component needs a {"source": {"git": {"url": "...", "revision": "..."}}}
# will that be too large for Tekton results?

jq --compact-output --raw-input --slurp < /tmp/all-images.txt '
jq --compact-output --raw-input --slurp < $IMAGES_FILE '
# split input file
split("\n") |
# drop empty lines
Expand Down
Loading