简体   繁体   中英

Run the YAML pipeline from another Azure DevOps Git repository

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM