azure-devops - 无法从 AppCenter 构建管道对 Azure DevOps Artifacts 源进行身份验证
问题描述
我在 appcenter 上构建了一个 ReactNative iOS 应用程序,它无法访问 Azure DevOps Artifacts 上的 npm 提要。这是该项目的工件。我尝试了一切,但没有看到问题。
项目根 .npmrc
@scope:registry=https://pkgs.dev.azure.com/org/_packaging/feed-name/npm/registry/
appcenter-post-clone.sh
# PACKAGES_READ_PASSWORD is PAT with packages read & write persmissions
PACKAGES_READ_PASSWORD_BASE64=$(echo ${PACKAGES_READ_PASSWORD} | base64)
cat >> ${HOME}/.npmrc << EOF
; begin auth token
//pkgs.dev.azure.com/org/_packaging/feed-name/npm/registry/:username=org
//pkgs.dev.azure.com/org/_packaging/feed-name/npm/registry/:_password=${PACKAGES_READ_PASSWORD_BASE64}
//pkgs.dev.azure.com/org/_packaging/feed-name/npm/registry/:email=sample@email.com
//pkgs.dev.azure.com/org/_packaging/feed-name/npm/:username=org
//pkgs.dev.azure.com/org/_packaging/feed-name/npm/:_password=${PACKAGES_READ_PASSWORD_BASE64}
//pkgs.dev.azure.com/org/_packaging/feed-name/npm/:email=sample@email.com
; end auth token
EOF
在 npm install 阶段,这是输出
npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="https://pkgsprodsu3weu.app.pkgs.visualstudio.com/"
我正在使用以下机器配置运行管道
Agent name: 'Hosted Agent'
Agent machine name: 'Mac-1622549610698'
Current agent version: '2.187.1'
##[group]Operating System
Mac OS X
10.15.7
19H1217
##[endgroup]
##[group]Virtual Environment
Environment: macos-10.15
Version: 20210525.2
Included Software: https://github.com/actions/virtual-environments/blob/macOS-10.15/20210525.2/images/macos/macos-10.15-Readme.md
Image Release: https://github.com/actions/virtual-environments/releases/tag/macOS-10.15%2F20210525.2
##[endgroup]
Current image version: '20210525.2'
Agent running as: 'runner'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: PowerShell (2.186.0)
Downloading task: ShellScript (2.165.2)
Downloading task: Bash (3.182.0)
Downloading task: CmdLine (1.1.3)
Downloading task: CmdLine (2.182.0)
Downloading task: InstallAppleCertificate (2.186.0)
Downloading task: InstallAppleProvisioningProfile (0.124.0)
Downloading task: CocoaPods (0.186.0)
Downloading task: Xcode (4.130.0)
Downloading task: CopyFiles (2.186.1)
Downloading task: PublishBuildArtifacts (1.186.0)
谢谢您的帮助
解决方案
推荐阅读
- java - 由于缺少谷歌应用 ID,构建失败
- android - 找不到正确的提供者
在此 MapSample 小部件上方 - ios - 提交 iOS 应用时 watchOS 应用出现问题
- reactjs - 无法从反应挂钩中的 public/images 文件夹中获取图像
- jquery - AdminLTE2 活动侧边栏仅在刷新后显示/更改
- excel - Excel宏给出循环引用错误
- python - 如何使用 Python 的循环从头开发 KNN 算法
- android - RxJava 3 对 Room 的支持
- node.js - typescript下如何使用kafka-node?
- python - 在 Python 中使用 Discord 机器人加入 + 离开