Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Caching absolute directory #241

@sdarwin

Description

@sdarwin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions