I've got a mono-repo setup with lerna
and yarn workspaces
.
To build the docker images for servers in the project, I'm using verdaccio as a GitLab service.
In the build phase, I want to publish packages and when running the server I'm planing to install them from the verdaccio registry.
With GitLab CI services we can not pass config files to the service. (APMK)
Currently the error I'm having is, error with auth, since I'm trying to publish a scoped package.
Step 14/24 : RUN lerna publish from-package --yes --no-git-reset
---> Running in 9c2db92f90f0
info cli using local version of lerna
lerna notice cli v4.0.0
lerna notice FYI Unable to verify working tree, proceed at your own risk
lerna WARN Unable to determine published version, assuming "@scope/package-1" unpublished.
lerna WARN Unable to determine published version, assuming "@scope/package-2" unpublished.
Found 2 packages to publish:
- @scope/package-1 => 1.0.0
- @scope/package-2 => 1.0.0
lerna info auto-confirmed
lerna info publish Publishing packages to npm...
lerna notice Skipping all user and access validation due to third-party registry
lerna notice Make sure you're authenticated properly ¯\_(ツ)_/¯
lerna notice FYI Unable to set temporary gitHead property, it will be missing from registry metadata
lerna info lifecycle root@undefined~prepare: root@undefined
lerna WARN lifecycle root@undefined~prepare: cannot run in wd root@undefined husky install (wd=/home/app)
lerna http fetch PUT 401 http://verdaccio:4873/@scope%2fpackage-1 26ms
lerna ERR! E401 authorization required to publish package @scope/package-1
The command '/bin/sh -c lerna publish from-package --yes --no-git-reset' returned a non-zero code: 1
In the CI environment I can not run npm adduser
since it's an interactive prompt. I tried few way to bypass is seems they doesn't work.
Some like
RUN npm adduser <<! \
auser \
'1234' \
user@domain.tld \
!
Can I create a user inside a Dockerfile or can I bypass auth for scoped packages?