From 394b379910c6d74bd115d3df2d92bca298f664dc Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 4 Aug 2021 18:10:31 +0200 Subject: [PATCH] CI: force cache pre-population --- scripts/pre_cache.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/pre_cache.sh b/scripts/pre_cache.sh index 76723c2f..d295f403 100755 --- a/scripts/pre_cache.sh +++ b/scripts/pre_cache.sh @@ -12,10 +12,11 @@ function prepopulate { if [[ ! -d $1 ]]; then mkdir -p "$1"; FRESH_CACHE=$(find "/ci-cache/$CI_PROJECT_NAME/$2" -mindepth 2 -maxdepth 2 \ - -type d -name "$CI_JOB_NAME" -not -path "$1" -exec stat --printf="%Y\t%n\n" {} \; |sort -n -r |head -1 |cut -f2); + -type d -name "$CI_JOB_NAME" -not -path "$1" -exec stat --printf="%Y\t%n\n" {} \; \ + |sort -n -r |head -1 |cut -f2); if [[ -d "$FRESH_CACHE" ]]; then echo "____Using" "$FRESH_CACHE" "to prepopulate the cache____"; - time cp -r "$FRESH_CACHE" "$1"; + time cp -rf "$FRESH_CACHE" "$1"; else echo "_____No such $2 dir, proceeding from scratch_____"; fi -- GitLab