在大型项目中在Azure DevOps中创建管道



我想完全自动化我当前的应用程序部署过程。

我在Azure DevOps有一个大项目。代码是在C#上为.Net内核编写的。该解决方案由3个站点和2个windows服务应用程序(构建到msi文件(组成。当我创建Pipelines并选择";Azure Repos Git";并点击我的项目,然后在配置你的管道中选择";ASP.NET CORE";。在";审查你的管道YAML";我有个问题。

如何在YAML文件中指向我想要构建的站点?

如何在YAML文件中指向我想要构建的站点?

当您使用Asp.net Core Yaml模板时,它将使用dotnet build脚本来构建您的项目。您可以将目标路径添加到dotnet构建命令中。

例如:

trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet build **/*.csproj --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'

另一方面,我建议您使用该任务来运行构建。

- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '--configuration $(BuildConfiguration)'

您可以在projects field中添加特定路径。

这是一份关于DotNetCoreCLI任务和任务介绍的文档。

最新更新