在VB6构建之后,如何在Azure Devops中设置“复制文件"任务? [英] How do I set up the Copy Files Task in Azure Devops after a VB6 build?

查看:112
本文介绍了在VB6构建之后,如何在Azure Devops中设置“复制文件"任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

针对此问题, VB6项目的Azure构建管道

到目前为止,我已经成功创建了以下构建管道

I have managed to create the following Build Pipeline so far

pool:
  name: Default
steps:
- script: |
   echo Write your commands here

   echo Use the environment variables input below to pass secret variables to this script
  vb6.exe /m /out errors.txt Project1.vbp
  workingDirectory: 'C:\dev\hello'
  failOnStderr: true
  displayName: vb6

- powershell: |
   # Write your powershell commands here.

   Write-Host "Hello World"

   # Use the environment variables input below to pass secret variables to this script.


   if(Test-Path .\errors.txt)
   {
      $file = Get-Content .\errors.txt 
      Remove-Item .\errors.txt

      if($file | Select-String "succeeded." -quiet) { exit 0 }

      $file | Where-Object {Write-Host "##vso[task.logissue type=error]$_"}
   }
  displayName: 'PowerShell Script'

当我运行它时,确实会在代理上创建.EXE.

When I run it, the .EXE does get created on the Agent.

下一步,我要将.EXE和.DLL复制到Azure存储位置.

Next I want to copy the .EXE and .DLLs to an Azure Storage location.

我了解我需要先使用复制文件"任务,然后再使用发布任务".

I understand I need to use the Copy Files Task and then a Publish Task.

我正在尝试使用设计器确定复制文件"任务的YAML

I am trying to use the designer to figure out the YAML for the Copy Files Task

,但我不知道要放什么.目标文本框不允许输入.

but I don't know what to put. The target text box is not allowing input.

[更新]

研究

I have been able to add the following task after studying the help However no files get copied.

  - task: CopyFiles@2
  inputs:
    contents: '*c:\dev\hello\*.exe*' 
    targetFolder: c:\dev\out2

推荐答案

  - task: CopyFiles@2
  inputs:
    SourceFolder: c:\dev\hello
    contents: '**.exe*'
    targetFolder: c:\dev\out2

其中c:\ dev \ hello是项目在构建代理上的位置

where c:\dev\hello is the location of the project on the build agent

[更新]

更好的表示法允许多种文件类型

And a nicer notation that allows for multiple file types is

- task: CopyFiles@2
  inputs:
    SourceFolder: c:\dev\hello
    contents:  |
              *.exe
              *.dll
    targetFolder: c:\dev\out2

这篇关于在VB6构建之后,如何在Azure Devops中设置“复制文件"任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆