This PR fixes a bug when using the cache for simple files.
Current behaviour:
The file is taken from the specified directory and cached into the /cache/owner/repo/job/ dir
When the restore happens it is again taken from a specified directory and restored to the current working dir (without the subdir context)
Rebuild
consider the following file structure
root.file
subdir/sub.file
During rebuild you endup with
/cache/owner/repo/job/root.file
/cache/owner/repo/job/sub.file
PR:
This patch first checks for the directory where the file is (using dirname), creates it in the cache directory and then rsyncs the file into the subdir (if any)
Same thing happens during restore, first check for the subdir in the project, create it with mkdir -p, then restore it using rsync
This PR fixes a bug when using the cache for simple files.
Current behaviour: The file is taken from the specified directory and cached into the /cache/owner/repo/job/ dir When the restore happens it is again taken from a specified directory and restored to the current working dir (without the subdir context)
Rebuild consider the following file structure root.file subdir/sub.file
During rebuild you endup with /cache/owner/repo/job/root.file /cache/owner/repo/job/sub.file
PR: This patch first checks for the directory where the file is (using
dirname
), creates it in the cache directory and then rsyncs the file into the subdir (if any)Same thing happens during restore, first check for the subdir in the project, create it with
mkdir -p
, then restore it using rsync