【问题标题】:azure devops build and deploy to app serviceazure devops 构建并部署到应用服务
【发布时间】:2020-05-25 14:32:29
【问题描述】:

我在 dev.azure.com 上创建了一个空项目

我已在本地计算机上克隆了存储库。

我已经在主文件夹中运行了这个命令:

$ dotnet new mvc

我已经创建了这个 azure-pipelines.yml 文件:

trigger:
- master

pool:
  vmImage: 'windows-latest'

steps:
- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'
    feedsToUse: 'select'
- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: true
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'artifact2'

我在 dev.azure.com 上添加、提交和推送文件(在主分支上)

我收到这条警告信息:

##[warning]Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'artifact2'.

我已创建发布管道,但出现错误:

##[error]Error: No package found with specified pattern: D:\a\r1\a\**\*.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.

我不明白用于工件生产的 azure-pipelines.yml 有什么问题...

谢谢

【问题讨论】:

  • 如果它有助于解决您的问题,请不要忘记投票。勾选 - 为你工作 - 和赞成 - 这是一个有用的答案。谢谢

标签: azure azure-pipelines azure-pipelines-release-pipeline


【解决方案1】:

发布的 dll 的放置似乎存在问题。试试下面的 yaml,我已经明确设置了已发布 dll 的输出目录并在发布后压缩了文件(这可能是您的下一个问题)。我还明确设置了在哪个文件夹中查找已发布的文件夹以发布工件。

trigger:
    - master

    pool:
      vmImage: 'windows-latest'

    steps:
    - task: DotNetCoreCLI@2
      inputs:
        command: 'restore'
        feedsToUse: 'select'
    - task: DotNetCoreCLI@2
      inputs:
        command: 'build'
    - task: DotNetCoreCLI@2
      inputs:
        command: 'publish'
        publishWebProjects: true
        modifyOutputPath: true
        arguments: '--configuration $(BuildConfiguration) --output "$(build.artifactstagingdirectory)"'
        zipAfterPublish: true
    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'artifact2'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-08-25
    • 2020-04-16
    • 1970-01-01
    • 2020-09-06
    • 2020-09-22
    • 2020-05-18
    • 1970-01-01
    • 2020-03-22
    相关资源
    最近更新 更多