简体   繁体   English

从Azure DevOps发布管道中获取文件

[英]Grab files from Azure DevOps Release Pipeline

I'm trying to do something I thought was super simple... I want to grab generated files (not built) and copy them to an Azure Blob storage 我正在尝试做一些我认为非常简单的事情...我想获取生成的文件(不是内置文件)并将其复制到Azure Blob存储中

In my Build the last step of my azure-pipeline.yml look like this: 在我的构建中,azure-pipeline.yml的最后一步如下所示:

- task: CopyFiles@2
  displayName: 'Copy generated content'
  inputs: 
    SourceFolder: '$(Build.SourcesDirectory)/output'
    contents: '**\*' 
    targetFolder: $(System.DefaultWorkingDirectory)/$(Release.PrimaryArtifactSourceAlias)/drop
    cleanTargetFolder: true

Then, in the Release I have an Azure CLI step with the inline following code: 然后,在发行版中,我有一个Azure CLI步骤,内嵌以下代码:

az storage blob upload-batch -s "$(System.DefaultWorkingDirectory)/$(Release.PrimaryArtifactSourceAlias)" -d '$web' --account-name frankdemo--account-key '_MYKEY_'

I try different combinations of paths, but nothing works... 我尝试了不同的路径组合,但没有任何效果...

Q: What should I put as targetFolder in my build and " -s " in my release? 问:我应该在我的版本中放入什么作为targetFolder ,在我的发行版中放入“ -s ”?

You will need to add step so it will publish artifacts 您将需要添加步骤,以便它将发布工件

steps:
- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: Server'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
    ArtifactName: Server

Then in your release you can use "Azure File Copy" to copy from your release to blob storatge 然后,在您的发行版中,您可以使用“ Azure File Copy”从发行版复制到Blob存储器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM