GitHub user aledsage opened a pull request:
https://github.com/apache/brooklyn/pull/23
jenkins: fix npm build, removing docker -u
npm writes to ~/.npm, and reads ~/.npmrc. But user 910 does
not exist in container, so has no home directory. Therefore
npm fails. Reverting `-u` for now.
e.g.
https://builds.apache.org/view/B/view/Brooklyn/job/brooklyn-master-build-docker-pipeline/10/console
failed with:
```
[INFO] --- frontend-maven-plugin:1.3:npm (npm install) @ brooklyn-ui-utils
---
[INFO] Running 'npm install' in
/home/jenkins/jenkins-slave/workspace/brooklyn-master-build-docker-pipeline/brooklyn-ui/ui-modules/utils
[ERROR] Unhandled rejection Error: EACCES: permission denied, mkdir '/.npm'
```
This stackoverflow looks useful for fixing it longer term:
https://stackoverflow.com/questions/46129443/sudo-permission-inside-docker-container-for-jenkins-pipeline.
We could `npm config set cache /tmp` and also `export HOME=...`.
Or we could create a user with id 910:910 in the container, as part of the
Dockerfile.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aledsage/brooklyn jenkins-pipeline-3
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn/pull/23.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #23
----
commit 18d07ee82b10c5fc9415accd200701e1e4ca8642
Author: Aled Sage <aled.sage@...>
Date: 2018-10-01T08:14:58Z
jenkins: fix npm build, removing docker -u
npm writes to ~/.npm, and reads ~/.npmrc. But user 910 does
not exist in container, so has no home directory. Therefore
npm fails. Reverting `-u` for now.
----
---