我有一个带有lerna
and的单一回购设置yarn workspaces
。
为了为项目中的服务器构建 docker 映像,我使用 verdaccio 作为 GitLab 服务。
在构建阶段,我想发布包,并且在运行服务器时,我计划从 verdaccio 注册表安装它们。
使用 GitLab CI 服务,我们无法将配置文件传递给服务。(APMK)
目前我遇到的错误是身份验证错误,因为我正在尝试发布一个范围包。
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
在 CI 环境中,我无法运行npm adduser
,因为它是交互式提示。我尝试了几种绕过方法似乎它们不起作用。
有些喜欢
RUN npm adduser <<! \
auser \
'1234' \
user@domain.tld \
!
我可以在 Dockerfile 中创建用户,还是可以绕过范围包的身份验证?