Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have multiple build pipelines for the same repository?

I have a repository with two solutions in it. Both solution files exist in the root directory, essentially like this:

/WebsiteOneDirectory/
/WebsiteTwoDirectory/
/.gitignore
/WebsiteOne.sln
/WebsiteTwo.sln

Is it possible for me to build multiple pipelines pointed at this repository to build the different solutions? When I create my first pipeline it is generating a azure-pipelines.yml file for the repo, so I am unsure how/if I am going to be able to have multiple pipeline configurations if that is a fixed name it expects.

like image 658
Patrick Avatar asked Oct 26 '18 16:10

Patrick


People also ask

How do I create multiple pipelines in Azure?

Create the pipelineSign in to your Azure DevOps organization and navigate to your project. In your project, go to the Pipelines page, and then select New pipeline. Select GitHub as the location of your source code. For Repository, select Authorize and then Authorize with OAuth.

Can you have multiple YAML files?

YAML Multi DocumentsYAML format allows multiple documents to be embedded in a single file. They only have to be separated with a line containing triple-dash separator ---.

Can Azure DevOps project have multiple repos?

Specify multiple repositories Repositories can be specified as a repository resource, or inline with the checkout step. The following repository types are supported. Only Azure Repos Git ( git ) repositories in the same organization as the pipeline are supported for multi-repo checkout in Azure DevOps Server 2020.


1 Answers

In addition to James Reed's answer, if you prefer using the .yml files, what I would recommend is to create multiple .yml definitions, one for each pipeline.

Here's what one would look like:

trigger:
  branches:
    include:
    - master
  paths:
    include:
    - WebsiteOneDirectory/*
    exclude:
    - WebsiteTwoDirectory/*

For building, you'd need to specify which solution to build. For a (.net core) example:

variables:
    buildConfiguration: 'Release'
pool:
    vmImage: 'Ubuntu-16.04'
steps:
- script: dotnet build WebsiteOne --configuration $(buildConfiguration)
like image 169
valentin Avatar answered Oct 03 '22 19:10

valentin