【发布时间】:2019-07-24 22:46:49
【问题描述】:
我正在使用 azure devops 多阶段管道并具有以下 YAML 文件。我可以创建一个构建,然后发布构建工件以删除。当我尝试部署时,我收到如下所示的错误。
我尝试了很多方法,但我希望我的部署在同一个管道中,因为我知道您可以将其添加到发布管道中。我错过了什么吗?
stages:
- stage: Build
jobs:
- job: Build
pool:
name: Hosted Windows 2019 with VS2019
demands: azureps
steps:
# Restore
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '**/*.csproj'
feedsToUse: select
vstsFeed : myfeed
includeNuGetOrg : true
# Build
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration Release'
# Publish
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
# Publish Artifact
- task: PublishBuildArtifacts@1
- stage: Dev
jobs:
# track deployments on the environment
- deployment: DeployWeb
pool:
vmImage: 'ubuntu-latest'
# creates an environment if it doesn’t exist
environment: 'my-dev'
strategy:
# default deployment strategy
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(build.ArtifactStagingDirectory)'
- task: AzureWebApp@1
displayName: Azure Web App Deploy
inputs:
appType: 'webapp'
azureSubscription: '213456123'
appName: mytestapp
package:$(System.DefaultWorkingDirectory)/**/*.zip
【问题讨论】:
-
在发布管道中有一个下载工件任务 - 将 zip 拖放到的日志输出,即
Downloading drop/ReleaseFiles.zip to C:\agents\release\1\_work\r9\a\Build\drop\\ReleaseFiles.zip,这将在部署阶段确认位置正确? -
你是怎么得到这个错误的?您的 yaml 中没有
Drop/DepartmentAPI.zip路径。
标签: azure-devops yaml devops