【问题标题】:Create Pipelines in Azure DevOps in a big project在大型项目中的 Azure DevOps 中创建管道
【发布时间】:2020-11-24 04:11:00
【问题描述】:
我想完全自动化我当前的应用程序部署过程。
我在 Azure DevOps 有一个大项目。代码是在 C# 上为 .Net 核心编写的。
该解决方案包含 3 个站点和 2 个 Windows 服务应用程序(构建到 msi 文件)。
当我创建管道并选择“Azure Repos Git”并单击我的项目时,然后在配置您的管道中选择“ASP.NET CORE”。
在“查看您的管道 YAML”时,我遇到了问题。
如何在 YAML 文件中指向我要构建的站点?
【问题讨论】:
标签:
asp.net-core
azure-devops
continuous-integration
azure-pipelines
【解决方案1】:
如何在 YAML 文件中指向我要构建的站点?
当您使用Asp.net Core Yaml 模板时,它将使用dotnet build 脚本来构建您的项目。您可以将目标路径添加到 dotnet build 命令。
例如:
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 task 和Task introduction 的文档。