Hi,
I am trying to follow the instructions found on the pnpm continuous integration page (see link in gh discussion) to use the pnpm package manager for node projects. I started a discussion here Usage with Jenkins · pnpm · Discussion #6869 · GitHub but I don’t expect there to be too many Jenkins experts on the pnpm issues board.
I’m having some permissions issues when running the following in my build script: sh 'corepack prepare pnpm@latest-8 --activate'
Thank you for the help. I tried setting COREPACK_HOME to JENKINS_HOME, and from what I can see, the /var/jenkins_home dir does not exist. When I try to ls it in the script, I get the error:
ls: cannot access ‘/var/jenkins_home/’: No such file or directory
I realize the issue is happening because my agent doesn’t know about /var/jenkins_home. I saw a SO post indicating that in the Jenkinsfile, you can set args to tell the docker container to mount a volume. In the agent | docker section, I added: args '--volume jenkins-pnpm:/var/jenkins_home:rw'
where jenkins-pnpm is a docker volume I created on my host machine.
When I run ls -l /var/jenkins_home now, I see that the current directory exists, but it is owned by root:root and only has write perms for the owner.
I haven’t been able to get past that issue.
The crux of the issue is that my user running the agent is id=502, which does not exist on the agent container. Maybe I need some more args?