git lfs pull after caching and filter for zip files in caching
parent
93f584dfc8
commit
1173911f95
|
|
@ -12,23 +12,25 @@ echo "$branchName"
|
||||||
echo "$libraryFolderFull"
|
echo "$libraryFolderFull"
|
||||||
echo "$purgeRemoteBuilderCache"
|
echo "$purgeRemoteBuilderCache"
|
||||||
|
|
||||||
|
cacheFolderWithBranch="$cacheFolderFull/$branchName"
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
# handle library cache
|
# handle library cache
|
||||||
if [ ! -d "$cacheFolderFull" ]; then
|
if [ ! -d "$cacheFolderFull" ]; then
|
||||||
echo "creating new cache folder $cacheFolderFull"
|
echo "creating new cache folder $cacheFolderFull"
|
||||||
mkdir "$cacheFolderFull"
|
mkdir "$cacheFolderFull"
|
||||||
if [ ! -d "$cacheFolderFull/$branchName" ]; then
|
if [ ! -d "$cacheFolderWithBranch" ]; then
|
||||||
echo "creating new cache branch folder for: $cacheFolderFull/$branchName"
|
echo "creating new cache branch folder for: $cacheFolderWithBranch"
|
||||||
mkdir "$cacheFolderFull/$branchName"
|
mkdir "$cacheFolderWithBranch"
|
||||||
else
|
else
|
||||||
echo "cache branch folder already exists for: $cacheFolderFull/$branchName"
|
echo "cache branch folder already exists for: $cacheFolderWithBranch"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "cache folder already exists $cacheFolderFull"
|
echo "cache folder already exists $cacheFolderFull"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Library cache for branch: $branchName"
|
echo "Library cache for branch: $branchName"
|
||||||
ls "$cacheFolderFull/$branchName"
|
ls -lh "$cacheFolderWithBranch"
|
||||||
echo ''
|
echo ''
|
||||||
|
|
||||||
if [ -d "$libraryFolderFull" ]; then
|
if [ -d "$libraryFolderFull" ]; then
|
||||||
|
|
@ -40,12 +42,15 @@ fi
|
||||||
echo "Checking cache"
|
echo "Checking cache"
|
||||||
|
|
||||||
# Restore library cache
|
# Restore library cache
|
||||||
latest=$(ls -t "$cacheFolderFull/$branchName" | head -1)
|
latest=$(ls -t "$cacheFolderWithBranch" | egrep -i -e '\\.zip$' | head -1)
|
||||||
if [ ! -z "$latest" ]; then
|
|
||||||
|
if [ "$(ls -A $latest)" ]; then
|
||||||
|
echo 'Cache empty'
|
||||||
|
else if [ ! -z "$latest" ]; then
|
||||||
echo "Library cache exists from build $latest from $branchName"
|
echo "Library cache exists from build $latest from $branchName"
|
||||||
echo 'Creating empty Library folder for cache'
|
echo 'Creating empty Library folder for cache'
|
||||||
mkdir "$libraryFolderFull"
|
mkdir "$libraryFolderFull"
|
||||||
unzip -q "$cacheFolderFull/$branchName/$latest" -d "$libraryFolderFull"
|
unzip -q "$cacheFolderWithBranch/$latest" -d "$libraryFolderFull"
|
||||||
else
|
else
|
||||||
echo 'Cache does not exist'
|
echo 'Cache does not exist'
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue