Hi folks. I'm facing a problem creating custom pipes that are supposed to share info via pipe storage dir.
Our setup is:
- We have a common repository for all pipe definitions, let's call it "pipes-repo", where each pipe is represented as a branch.
- Each pipe is supposed to be able to read info saved in the storage dir by a previous pipe, and write it's own data according to this manual.
Problem: the first pipe successfully writes a file to the storage dir, the next pipe can read it, but cannot write its own file - got "Permission denied" error.
My guess is that's because with this setup the $BITBUCKET_PIPE_STORAGE_DIR clashes with $BITBUCKET_PIPE_SHARED_STORAGE_DIR/<account>/<pipe-name>. The <pipe-name> seems to be equal to repo name and disregards the branch name.
Like, with <account> = "my-company" and <pipe-name> = "pipes-repo":
- $BITBUCKET_PIPE_STORAGE_DIR = “<…>/generated/pipeline/pipes/my-company/pipes-repo”
- And also $BITBUCKET_PIPE_SHARED_STORAGE_DIR/<account>/<pipe-name> = “<…>/generated/pipeline/pipes/my-company/pipes-repo”
The bitbucket-pipeline.yaml is super simple and can be boiled down to:
pipelines:
branches:
master:
- step:
name: Do the 1st thing
script:
- pipe: my-company/pipes-repo:my-pipe-1
- step:
name: Do the 2nd thing
script:
- pipe: my-company/pipes-repo:my-pipe-2
I would greatly appreciate any tips! Thanks!
UPDATE: I've actually tried this with the exactly the same pipe, it's the same error.
pipelines:
branches:
master:
- step:
name: Do the 1st thing
script:
- pipe: my-company/pipes-repo:my-pipe-1
- step:
name: Do the 2nd thing
script:
- pipe: my-company/pipes-repo:my-pipe-1
So, basically, when the 1st step runs, the "root" user is the owner of the pipe storage dir (<…>/generated/pipeline/pipes/my-company/pipes-repo).
But when the second step runs, this folder is mounted and "nobody" is the owner. So though it's literally the same pipe, and it should be able to use its own storage folder - it cannot.
I also tried chmod and chown - no luck, "Operation not permitted".