Skip to content
Snippets Groups Projects
Commit deb6cc98 authored by Walter Lozano's avatar Walter Lozano
Browse files

Only pass cache if file is not empty


In commit 797862 the logic continues even if the cache file cannot be
downloaded. Unfortunately this approach is buggy since wget can create
empty files if the download fails.

To avoid passing an invalid cache file, check if file is not empty.

Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
parent ebab6716
No related branches found
No related tags found
1 merge request!179Use JSON to improve efficiency
......@@ -148,7 +148,7 @@ packaging-data-fetch-downstream:
wget --header "JOB-TOKEN: $CI_JOB_TOKEN" "$ARTIFACT_URL" -O cache.yaml || true
fi
- |
if [ -e cache.yaml ] && [ "$DISABLE_CACHE" == "no" ]
if [ -s cache.yaml ] && [ "$DISABLE_CACHE" == "no" ]
then
echo Load cacheable data from cache.yaml
CACHE_ARGS="--cache cache.yaml"
......@@ -192,7 +192,7 @@ packaging-data-fetch-sources-upstream:
wget --header "JOB-TOKEN: $CI_JOB_TOKEN" "$ARTIFACT_URL" -O cache.yaml || true
fi
- |
if [ -e cache.yaml ] && [ "$DISABLE_CACHE" == "no" ] && [ "$FILTER_ON_CACHE" == "yes" ]
if [ -s cache.yaml ] && [ "$DISABLE_CACHE" == "no" ] && [ "$FILTER_ON_CACHE" == "yes" ]
then
echo Load cacheable data from cache.yaml
CACHE_ARGS="--cache cache.yaml"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment