Verified Commit 281b851c authored by Denis_P's avatar Denis_P 🏑
Browse files

change (CI): do not look in the same dir

parent f4cb2b06
......@@ -10,10 +10,10 @@ set -u
function prepopulate {
if [[ ! -d $1 ]]; then
mkdir -p "/ci-cache/$CI_PROJECT_NAME/$2/$CI_COMMIT_REF_NAME/$CI_JOB_NAME";
mkdir -p "$1";
FRESH_CACHE=$(find "/ci-cache/$CI_PROJECT_NAME/$2" -mindepth 2 -maxdepth 2 \
-type d -name "$CI_JOB_NAME" -exec stat --printf="%Y\t%n\n" {} \; |sort -n -r |head -1 |cut -f2);
if [[ -d $FRESH_CACHE ]]; then
-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";
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment