Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps - multiple repo checkout

Scenario

  • My code is one repository and all my dependencies is in another repo (another project) that I need to build my code.

Following is my 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)'

When I run my pipeline, I got the following error:

Checkout of repository 'myLibraries' is not supported. Only 'self' and 'none' are supported.,Checkout of multiple repositories is not supported.

references:

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

like image 273
sedrac Avatar asked Dec 01 '22 09:12

sedrac


1 Answers

Multiple repository checkout is now supported - https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#multi-repo-checkout

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)
like image 63
MotoWilliams Avatar answered Dec 03 '22 21:12

MotoWilliams