[英]Azure DevOps Build Pipeline: 'publish' command is executing 'dotnet build' instead of 'dotnet publish'
I have an azure build pipeline that I'm trying to modify to add build and publish and an azure function.我有一个 azure 构建管道,我正在尝试修改它以添加构建和发布以及一个 azure 函数。
I'm trying to run a 'publish' command using the dotnet cli, but for whatever reason, azure devops is running a 'build' command instead.我正在尝试使用 dotnet cli 运行“发布”命令,但无论出于何种原因,azure devops 正在运行“构建”命令。
My pipeline looks like this:我的管道如下所示:
trigger:
- master
variables:
solution: "**/*.sln"
jobs:
- job: backend_build
- task: DotNetCoreCLI@2
inputs:
commands: "publish"
publishWebProjects: false
projects: "someFunction.csproj"
arguments: "--configuration Release -r win10-x64"
displayName: "Publish someFunction"
- task: PublishPipelineArtifact@1
inputs:
path: "$(System.DefaultWorkingDirectory)/someFunction/bin/Release/netcoreapp3.1/win10-x64/publish.zip"
artifact: "ApplyMigrations"
displayName: "Publish someFunction Function"
But when this pipeline executes, that Publish someFunction
task ends up executing dotnet build
instead of dotnet publish
但是当这个管道执行时, Publish someFunction
任务最终会执行dotnet build
而不是dotnet publish
47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
2020-10-27T20:36:40.0448279Z ##[debug]/usr/bin/dotnet arg: --configuration Release -r win10-x64
2020-10-27T20:36:40.0454259Z ##[debug]exec tool: /usr/bin/dotnet
2020-10-27T20:36:40.0454556Z ##[debug]arguments:
2020-10-27T20:36:40.0454825Z ##[debug] build
2020-10-27T20:36:40.0455170Z ##[debug] /home/vsts/work/1/s/someFunction.csproj
2020-10-27T20:36:40.0456258Z ##[debug] -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
2020-10-27T20:36:40.0457276Z ##[debug] --configuration
2020-10-27T20:36:40.0457663Z ##[debug] Release
2020-10-27T20:36:40.0463060Z ##[debug] -r
2020-10-27T20:36:40.0463499Z ##[debug] win10-x64
2020-10-27T20:36:40.0465119Z [command]/usr/bin/dotnet build /home/vsts/work/1/s/someFunction.csproj -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers
Anyone have any ideas why this might be happening?任何人都知道为什么会发生这种情况? There are no errors being displayed, it just isn't executing the right command...没有显示错误,只是没有执行正确的命令...
Your error is commands: "publish"
.您的错误是commands: "publish"
。 It should be command
, not commands
.它应该是command
,而不是commands
。
Because you have not included a command
value, it uses the default value of Build.因为您没有包含command
值,所以它使用 Build 的默认值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.