场景
以下是我的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”。仅支持“自我”和“无”。不支持多个存储库的签出。
参考:
https://github.com/microsoft/azure-pipelines-yaml/blob/master/design/multicheckout.md https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#using-other-repositories
答案 0 :(得分:1)
您发布的文字提供了答案:
不支持检出多个存储库。
如果要在构建中使用多个存储库,则需要自己执行。
一些选项:
git clone
步骤可以克隆第二个存储库所有这些都有优点和缺点。
答案 1 :(得分:0)
resources:
repositories:
- repository: MyGitHubRepo # The name used to reference this repository in the checkout step
type: github
endpoint: MyGitHubServiceConnection
name: MyGitHubOrgOrUser/MyGitHubRepo
- repository: MyBitBucketRepo
type: bitbucket
endpoint: MyBitBucketServiceConnection
name: MyBitBucketOrgOrUser/MyBitBucketRepo
- repository: MyAzureReposGitRepository
type: git
name: MyProject/MyAzureReposGitRepo
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- checkout: MyGitHubRepo
- checkout: MyBitBucketRepo
- checkout: MyAzureReposGitRepository
- script: dir $(Build.SourcesDirectory)