【发布时间】:2022-11-30 14:59:49
【问题描述】:
您好,我遇到了问题。假设我有一个简单的 Web 应用程序并将其推送到 Azure Repos。现在,我使用 yaml 设置构建管道,然后设置发布管道,该管道需要来自构建管道的工件。所以我正在使用 PublishPipelineArtifact@1。构建管道运行良好,但我的发布管道失败并出现错误 Deployment of msBuild generated package is not supported。更改包格式或使用 Azure 应用服务部署任务。 D:\a\r1\a_ReleasePipelines\drop\WebApp.zip。 那么如何以正确的命名顺序提供发布管道所需的工件呢?
下面是我用于构建管道的 yaml
`
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(build.artifactStagingDirectory)'
publishLocation: 'pipeline'
` 接下来,我将使用空作业设置一个简单的发布管道,并在 Add Artifact 中提供项目名称和源代码。
【问题讨论】:
标签: azure-devops azure-pipelines azure-pipelines-release-pipeline