我在Azure DevOps中具有以下发布和部署任务:
variables:
buildConfiguration: 'Release'
buildPlatform: 'any cpu'
azureSubscription: 'subscription'
azureAppType: 'Web App on Windows'
webAppName: 'webapp'
steps:
# Other tasks
- task: DotNetCoreCLI@2
displayName: 'Publish'
inputs:
command: publish
publishWebProjects: false
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)'
zipAfterPublish: true
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy'
inputs:
package: $(System.DefaultWorkingDirectory)/**/MyProj.zip
azureSubscription: '$(azureSubscription)'
appType: '$(azureAppType)'
webAppName: '$(webAppName)'
发布任务成功,但是我在Deploy任务中遇到了错误:
[error]Error: No package found with specified pattern: /home/vsts/work/1/s/**/MyProj.zip
我在做什么错了?
答案 0 :(得分:0)
查看您的YAML:
您使用以下参数发布:
--output $(build.artifactstagingdirectory)
您尝试从完全不同的位置进行部署:
package: $(System.DefaultWorkingDirectory)/**/MyProj.zip
尝试部署$(build.artifactstagingdirectory)/**/MyProj.zip
。