作为回应关于为 VB6 项目制作 Azure 构建管道的问题 https://stackoverflow.com/questions/54796027/how-do-i-specify-my-custom-agent-in-the-build-pipeline
到目前为止我已经成功创建了以下构建管道
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 确实在代理上创建。
接下来,我要将 .EXE 和 .DLL 复制到 Azure 存储位置。
我知道我需要使用复制文件任务,然后使用发布任务。
我正在尝试使用设计器来找出复制文件任务的 YAML
but I don't know what to put. The target text box is not allowing input.
[Update]
学习后我已经能够添加以下任务但是没有文件被复制。
- 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 是构建代理上项目的位置
[Update]
允许多种文件类型的更好的表示法是
- task: CopyFiles@2
inputs:
SourceFolder: c:\dev\hello
contents: |
*.exe
*.dll
targetFolder: c:\dev\out2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)