如何解决在AzureRmWebAppDeployment @ 4中找不到具有指定模式的包
我有以下Azure Pipelines作业:
- job: Publish
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: UseDotNet@2
displayName: Setup
inputs:
packageType: sdk
version: 3.1.x
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: false
projects: 'src/**/*.csproj'
arguments: '--configuration staging --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishPipelineArtifact@1
displayName: Export
inputs:
artifact: 'Staging'
targetPath: '$(Build.ArtifactStagingDirectory)'
- deployment: Deploy
dependsOn: Publish
pool:
vmImage: Ubuntu-16.04
environment: staging
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact@2
displayName: Import
inputs:
artifact: 'Staging'
- task: AzureRmWebAppDeployment@4
displayName: Api
inputs:
connectedServiceName: '$(azure.subscription)'
webAppKind: 'webApp'
webAppName: 'bityond-demo-api'
package: '$(Build.ArtifactStagingDirectory)/Api.zip'
removeAdditionalFilesFlag: true
运行管道时,以下任务成功完成:
- 设置
- 发布
- 导出
- 导入
然后在最后一个任务“ Api”上-AzureRmWebAppDeployment @ 4,出现错误:
##[error]Error: No package found with specified pattern: /home/vsts/work/1/a/Api.zip<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
我检查了一下,发现了可用的工件,并且能够下载它们。
导入任务成功了,所以我想念什么?
解决方法
尝试为导入的工件指定目标目录:
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'Staging'
targetPath: '$(Build.ArtifactStagingDirectory)'
如果未指定,默认情况下会将工件下载到$ {Pipeline.Workspace)目录中,该目录等于/home/vsts/work/1
。对于AzureRmWebAppDeployment@4
任务,您需要在$(Build.ArtifactStagingDirectory)
目录(等于/home/vsts/work/1/a
)中寻找工件
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。