phive
phive copied to clipboard
"Creating directory failed" in GitLab CI
When executing phive install
in GitLab CI as a non-root user, a "creating directory failed" error occurs.
You can see an example here: https://dev.quiqqer.com/quiqqer/quiqqer/-/jobs/6108
I tried to debug this and came to the following conclusion:
- the repository/project is automatically cloned by GitLab CI with the
root
user as the owner andchmod 666
(see example) - the user executing
phive install
iswww-data
(see example) - if the
phive.xml
already exists, the methodPharIo\FileSystem\Directory->ensureExists()
tries tochmod
the project directory (see code) - as the executing user is
www-data
and thus does not own the project directory, thechmod
fails due to lack of permission
Am I doing something wrong or is this a bug?
Is PHIVE even meant to be used in CI to install tooling?
Is it correct to use the phive.xml
file or should I use a different file for that?