场景
- 我的代码在一个代码库中,而我需要构建代码的所有依赖项位于另一个代码库(另一个项目)中。
以下是我的azure-pipelines.yml文件
# File: azure-pipelines.yml
pool:
vmImage: 'ubuntu-latest'
variables:
phpVersion: 7.3
resources:
repositories:
- repository: myLibraries
type: git
name: myProject/libraries
steps:
- checkout: self
- checkout: myLibraries
path: libraries
- script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
php -version
displayName: 'Use PHP version $(phpVersion)'
当我运行我的流水线时,出现以下错误:
不支持检出存储库“myLibraries”。仅支持“self”和“none”。不支持检出多个存储库。
参考资料:
https://github.com/microsoft/azure-pipelines-yaml/blob/master/design/multicheckout.md https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#using-other-repositories