'I want to create a CICD for my azure repo which has multiple projects in its subfolders
My azure repo has multiple projects in it (it is not a single solution with multiple projects), which are placed in subfolders. How to publish artifacts separately for each of the project, which are placed in different folders.
Solution 1:[1]
By using paths include statements you can specify a build file and a trigger for each of the subdirectories.
An example below
trigger:
branches:
include:
- refs/heads/Development
paths:
include:
- slapi
- slapi.Common
batch: True
name: $(date:yyyyMMdd)$(rev:.r)
This allows each subdirectory to trigger and build to a separate output directory as needed.
In Azure Devops you then import this build YAML file to create your build pipeline and then when you create your release pipeline you select this build pipeline as the source for the drop files
Obviously you need to complete the above example file with the actual build configuration but since the question was about using subdirectories I included the relevant parts.
For your working directories use the variables section like this to specify the project at hand
variables:
vmImageName: "windows-2022"
workingDirectory: "projectName" <- change this to your real project name
then refer to the variables in your build task like this
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: "build"
projects: |
$(workingDirectory)/*.csproj
arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
