我正在使用Azure CI / CD管道进行Flutter构建。在我的Pubspec yaml文件中,我的项目具有私有依赖关系,并且代码托管在相同的Azure devops项目中,但位于不同的存储库中。在构建期间(即Flutter Packages得到),它给我错误提示身份验证失败?。我尝试使用PAT令牌,在颤振构建任务之前,我使用git命令设置了该令牌,但是并没有解决问题。谁能帮帮我?
我愿意向人们展示更好的方法,但是这些是我不久前解决此问题所采取的步骤。
假设您在azsh devops上使用git over ssh引用pubspec.yaml中的包,>
repo_name:
git:
ref: 'tag or other identifier'
url: [email protected]:v3/you/project/repo_name
因此,在我的azure-pipelines.yaml中,安装ssh密钥步骤看起来像这样,其中id_rsa是我的安全文件中私钥的名称。
- task: InstallSSHKey@0
inputs:
knownHostsEntry: 'vs-ssh.visualstudio.com, ...etc'
sshPublicKey: 'ssh-rsa ...etc'
sshKeySecureFile: id_rsa