Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching absolute directory #241

Open
sdarwin opened this issue Mar 14, 2023 · 0 comments
Open

Caching absolute directory #241

sdarwin opened this issue Mar 14, 2023 · 0 comments

Comments

@sdarwin
Copy link

sdarwin commented Mar 14, 2023

Describe the bug

It's possible that I am just making a stupid mistake, but here is a description of the problem. Trying to cache a directory that is outside the main source folder using an absolute path.

The workspace is "/drone/src".
Configure the drone-cache mount to be "/drone/cache".

Near the end of the build process, run "ls -al /drone" to observe the directory contents.

 ls -al /drone
total 16
drwxr-xr-x  4 root root 4096 Mar 14 16:26 .
drwxr-xr-x  1 root root 4096 Mar 14 16:25 ..
drwxr-xr-x 12 root root 4096 Mar 14 16:27 cache
drwxr-xr-x 17 root root 4096 Mar 14 16:26 src

So, everything seems to be in place. The final step in the drone pipeline is to run rebuild:

      "name": "rebuild-cache",
      "image": "meltwater/drone-cache",
      "mount": mountpoints
      ... 

mountpoints is a variable that in this case should be ["/drone/cache"]).
Archive format isn't specified, so it's using the default (tar).
The final output of the rebuild shows an error that the directory doesn't exist.

level=error name=drone-cache ts=2023-03-14T16:27:20.348382792Z caller=main.go:628 err="[IMPORTANT] build cache, source </drone/cache>, make sure file or directory exists and readable, lstat /drone/cache: no such file or directory\n"

Expected behavior
/drone/cache can be cached and restored correctly.

Should it be working? and are there currently test cases in CI which test the absolute path feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant