Skip to content

Commit

Permalink
CI: force cache pre-population (use-ink#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
TriplEight authored Aug 5, 2021
1 parent f86db30 commit 646eaed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/pre_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 646eaed

Please sign in to comment.