0
votes

Could you please help me. How I can run the YAML pipeline from another Azure DevOps Git repository? I have two repositories, one for templates, one for code source. My code:

resources:      
  repositories: 
  - repository: CodeServerGit
    name: BoxServer/CodeServerGit
    type: git 
    #connection: CodeServerGit
    ref: /v1/dev
   # source: /v1/dev  

I have an error

[error]Project file(s) matching the specified pattern were not found.

I see that I am in the wrong repository. Assembly goes in the repository in which the template is located, and does not connect to the repository in which the code.

1
Hi, Vitalii, any process on this issue? could you achieve it successfully now? If yes, you can accept the answer that will help other community members who easier search this useful information, it just a reminder :)Merlin Liang - MSFT

1 Answers

2
votes

Since what you want to link is Azure Devops git repos, please check below sample which work for me:

resources:      
  repositories: 
  - repository: {repos name}
    name: {project name}/{repos name}
    type: git 
    ref: master #branch name

jobs: 
    - template: azure-pipelines-1.yml@{repos name}

The above script is not very complicated, but there are many places should be noted.

(1) The project which store the template YAML file should be in the same organization.

(2) For the value of ref, if what you want is branch, just input the branch name here. The server will automatically add refs/heads before the value after the queue start.

If here you want to specify a tag, you must fill it with a completed format: refs/tags/{tag name}.

(3) Do not forget to specify the repos name after @ when you trying to call one template

See the doc.