cleanup and corrections
parent
62a2b59a20
commit
88c4b1efee
|
|
@ -2181,18 +2181,13 @@ class RemoteBuilder {
|
||||||
echo 'Initializing source repository for cloning with caching of LFS files'
|
echo 'Initializing source repository for cloning with caching of LFS files'
|
||||||
${initializeSourceRepoForCaching}
|
${initializeSourceRepoForCaching}
|
||||||
ls -alh "${testLFSFile}"
|
ls -alh "${testLFSFile}"
|
||||||
ls -alh "${lfsDirectory}"
|
|
||||||
echo 'Source repository initialized'
|
echo 'Source repository initialized'
|
||||||
echo ' '
|
echo ' '
|
||||||
echo 'Checking cache for the Unity project Library and git LFS files'
|
echo 'Checking cache for the Unity project Library and git LFS files'
|
||||||
${handleCaching}
|
${handleCaching}
|
||||||
echo 'Caching complete'
|
echo 'Caching complete'
|
||||||
echo ' '
|
echo ' '
|
||||||
cd ${this.repoPathFull}
|
|
||||||
git lfs pull
|
|
||||||
ls -alh "${testLFSFile}"
|
ls -alh "${testLFSFile}"
|
||||||
zip -r lib-${buildUid}.zip "${lfsDirectory}"
|
|
||||||
cp lib-${buildUid}.zip "${cacheFolderFull}/${branchName}/lfs"
|
|
||||||
echo ' '
|
echo ' '
|
||||||
#
|
#
|
||||||
echo 'buildVolumeReport.txt and buildVolumeReport.txt saved to repository workspace directory'
|
echo 'buildVolumeReport.txt and buildVolumeReport.txt saved to repository workspace directory'
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -25,4 +25,6 @@ echo ' '
|
||||||
echo 'Contents of .lfs-assets-id-sum file:'
|
echo 'Contents of .lfs-assets-id-sum file:'
|
||||||
cat .lfs-assets-id-sum
|
cat .lfs-assets-id-sum
|
||||||
|
|
||||||
|
export LFS_ASSETS_HASH=$(cat ".lfs-assets-id")
|
||||||
|
|
||||||
echo ' '
|
echo ' '
|
||||||
|
|
|
||||||
|
|
@ -7,43 +7,50 @@ gitLFSDestinationFolder=$4
|
||||||
purgeRemoteBuilderCache=$5
|
purgeRemoteBuilderCache=$5
|
||||||
|
|
||||||
cacheFolderWithBranch="$cacheFolderFull/$branchName"
|
cacheFolderWithBranch="$cacheFolderFull/$branchName"
|
||||||
|
lfsCacheFolder="$cacheFolderFull/$branchName/lfs"
|
||||||
|
libraryCacheFolder="$cacheFolderFull/$branchName/lib"
|
||||||
|
|
||||||
echo " "
|
|
||||||
|
|
||||||
mkdir -p "$cacheFolderWithBranch/lib"
|
|
||||||
mkdir -p "$cacheFolderWithBranch/lfs"
|
|
||||||
|
|
||||||
echo "Library cache for branch: $branchName"
|
|
||||||
ls -lh "$cacheFolderWithBranch"
|
|
||||||
ls -lh "$cacheFolderWithBranch/lib"
|
|
||||||
ls -lh "$cacheFolderWithBranch/lfs"
|
|
||||||
echo ' '
|
echo ' '
|
||||||
|
|
||||||
|
echo "LFS cache for branch: $branchName"
|
||||||
|
mkdir -p "$lfsCacheFolder"
|
||||||
|
ls -lh "$lfsCacheFolder"
|
||||||
|
echo "Library cache for branch: $branchName"
|
||||||
|
mkdir -p "$libraryCacheFolder"
|
||||||
|
ls -lh "$libraryCacheFolder"
|
||||||
|
|
||||||
|
echo ' '
|
||||||
|
|
||||||
|
# if the unity git project has included the library delete it and echo a warning
|
||||||
if [ -d "$libraryFolderFull" ]; then
|
if [ -d "$libraryFolderFull" ]; then
|
||||||
rm -r "$libraryFolderFull"
|
rm -r "$libraryFolderFull"
|
||||||
echo "Git must ignore the Library folder"
|
echo "!Warning!: The Unity library was included in the git repository (this isn't usually a good practice)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Checking cache"
|
echo "Checking cache"
|
||||||
|
|
||||||
# Restore library cache
|
# Restore library cache
|
||||||
latest=$(ls -t "$cacheFolderWithBranch/lib" | egrep -i -e '\\.zip$' | head -1)
|
latestLibraryCacheFile=$(ls -t "$libraryCacheFolder" | egrep -i -e '\\.zip$' | head -1)
|
||||||
|
|
||||||
if [ ! -z "$latest" ]; then
|
if [ ! -z "$latestLibraryCacheFile" ]; then
|
||||||
echo "Library cache exists from build $latest from $branchName"
|
echo "Library cache exists from build $latestLibraryCacheFile from $branchName"
|
||||||
echo 'Creating empty Library folder for cache'
|
echo 'Creating empty Library folder for cache'
|
||||||
mkdir "$libraryFolderFull"
|
mkdir "$libraryFolderFull"
|
||||||
unzip -q "$cacheFolderWithBranch/lib/$latest" -d "$libraryFolderFull"
|
unzip -q "$libraryCacheFolder/$latestLibraryCacheFile" -d "$libraryFolderFull"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore LFS cache
|
# Restore LFS cache
|
||||||
latest=$(ls -t "$cacheFolderWithBranch/lfs" | egrep -i -e '\\.zip$' | head -1)
|
if [[ ! -v "$LFS_ASSETS_HASH" ]]; then
|
||||||
|
latestLFSCacheFile=LFS_ASSETS_HASH
|
||||||
|
else
|
||||||
|
latestLFSCacheFile=$(ls -t "$cacheFolderWithBranch/lfs" | egrep -i -e '\\.zip$' | head -1)
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$latest" ]; then
|
if [ ! -z "$latestLFSCacheFile" ]; then
|
||||||
echo "Library cache exists from build $latest from $branchName"
|
echo "LFS cache exists from build $latestLFSCacheFile from $branchName"
|
||||||
echo 'Creating empty Library folder for cache'
|
rm -r "$gitLFSDestinationFolder"
|
||||||
mkdir "$libraryFolderFull"
|
mkdir -p "$gitLFSDestinationFolder"
|
||||||
unzip -q "$cacheFolderWithBranch/lfs/$latest" -d "$gitLFSDestinationFolder"
|
unzip -q "$cacheFolderWithBranch/lfs/$latestLFSCacheFile" -d "$gitLFSDestinationFolder"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
du -sch "$cacheFolderWithBranch/lfs"
|
du -sch "$cacheFolderWithBranch/lfs"
|
||||||
|
|
@ -59,3 +66,7 @@ echo "purge $purgeRemoteBuilderCache"
|
||||||
if [ "$purgeRemoteBuilderCache" == "true" ]; then
|
if [ "$purgeRemoteBuilderCache" == "true" ]; then
|
||||||
rm -r "$cacheFolderFull"
|
rm -r "$cacheFolderFull"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git lfs pull
|
||||||
|
zip -r $LFS_ASSETS_HASH "${lfsDirectory}"
|
||||||
|
cp $LFS_ASSETS_HASH "${cacheFolderFull}/${branchName}/lfs"
|
||||||
|
|
|
||||||
|
|
@ -138,19 +138,13 @@ class RemoteBuilder {
|
||||||
echo 'Initializing source repository for cloning with caching of LFS files'
|
echo 'Initializing source repository for cloning with caching of LFS files'
|
||||||
${initializeSourceRepoForCaching}
|
${initializeSourceRepoForCaching}
|
||||||
ls -alh "${testLFSFile}"
|
ls -alh "${testLFSFile}"
|
||||||
ls -alh "${lfsDirectory}"
|
|
||||||
echo 'Source repository initialized'
|
echo 'Source repository initialized'
|
||||||
echo ' '
|
echo ' '
|
||||||
echo 'Checking cache for the Unity project Library and git LFS files'
|
echo 'Checking cache for the Unity project Library and git LFS files'
|
||||||
${handleCaching}
|
${handleCaching}
|
||||||
echo 'Caching complete'
|
echo 'Caching complete'
|
||||||
echo ' '
|
echo ' '
|
||||||
cd ${this.repoPathFull}
|
|
||||||
git lfs pull
|
|
||||||
ls -alh "${testLFSFile}"
|
ls -alh "${testLFSFile}"
|
||||||
ls -alh "${lfsDirectory}"
|
|
||||||
zip -r lib-${buildUid}.zip "${lfsDirectory}"
|
|
||||||
cp lib-${buildUid}.zip "${cacheFolderFull}/${branchName}/lfs"
|
|
||||||
echo ' '
|
echo ' '
|
||||||
#
|
#
|
||||||
echo 'buildVolumeReport.txt and buildVolumeReport.txt saved to repository workspace directory'
|
echo 'buildVolumeReport.txt and buildVolumeReport.txt saved to repository workspace directory'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue