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

Fix caching of images when multiple images specified #150

Merged
merged 3 commits into from
Dec 3, 2019
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions build/scripts/cache_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ images=$(yq -S -r '.icon' "${metas[@]}" | sort | uniq)
mkdir -p "$RESOURCES_DIR" "$TEMP_DIR"

echo "Caching images referenced in devfiles"
for image in "${images[@]}"; do
while read -r image; do
# Workaround for getting filenames through content-disposition: copy to temp
# dir and read filename before moving to /resources.
wget -P "${TEMP_DIR}" -nv --content-disposition "${image}"
Expand All @@ -47,6 +47,6 @@ for image in "${images[@]}"; do
cached_url="{{ DEVFILE_REGISTRY_URL }}/${cached_image#/}"
sed -i "s|${image}|${cached_url}|g" "${metas[@]}" "$INDEX_JSON"
echo " Updated devfiles to point at cached image"
done
done <<< "$images"

rm -rf "$TEMP_DIR"