| In the scenario where you have a pipeline where you have 2 stages, each of them executed in a docker container where the USER of the container is "root". You would have the following problem. Imagine that Stage A executes something like: sh ("mkdir -p foo/bar"). This will generate the directories foo and bar with user and group permissions of "root". Stage B executes using dir("foo/bar") the following command : sh ("touch somefile.txt"). Due to the fact that dir() tries to create a @tmp directory within "foo/bar" the pipeline will fail prompting something like this:
Exception: java.nio.file.AccessDeniedException: </path/to/the/workspace...>/foo/bar/@tmp
I omit the workspace path as it is not relevant. Why is this @tmp creation actually needed? |