Make more intelligent use of the cache
Bust cache on the dynamic files Use the cached builds for both virtualbox and Hyper-V Hopefully improve loop downloading files to cache
This commit is contained in:
+7
-1
@@ -10,6 +10,10 @@ variables:
|
||||
|
||||
generate:
|
||||
stage: generate
|
||||
cache:
|
||||
- key: isofiles
|
||||
paths:
|
||||
- cache/*.iso
|
||||
artifacts:
|
||||
paths:
|
||||
- distros/**/*.pkrvars.hcl
|
||||
@@ -78,7 +82,9 @@ downloads:
|
||||
for vars in $(find distros/ -name '*.pkrvars.hcl'); do
|
||||
file=$(echo var.iso.url | packer console -var-file=${vars} -config-type=hcl2 sources/)
|
||||
base="$(basename "${file}")"
|
||||
if [ ! -e "cache/${base}" ]; then
|
||||
if [ -e "cache/${base}" ]; then
|
||||
echo "Cached file already exists"
|
||||
else
|
||||
files+=("-O" "${file}")
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user