![](/img/trans.png)
[英]How to pass the output from kubectl task to next task in Azure Devops
[英]Is it possible to copy output file of one task to be and access from next task in the Azure pipeline?
我有一個 azure 管道,其中一個任務運行性能測試,output 結果在 json 文件中。 我想在我調用的另一個任務中復制 Json 文件。Net 單元測試代碼將鍵值與預期的 json 文件進行比較。 我能夠將文件復制到某個文件夾中可能是自定義文件夾
像TargetFolder: '$(Build.BinariesDirectory)/testfolder'
或在$(Build.BinariesDirectory)
中。 該文件被成功復制。
但是我無法從為我的下一個單元測試任務復制文件的位置讀取文件。
有可能嗎?
是的,您可以在構建的任何任務中讀取文件。 例如:
pool:
name: Azure Pipelines
steps:
- script: |
@echo off
echo Write your commands here> test.txt
echo Hello world>> test.txt
displayName: 'Command Line Script'
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: .
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- script: 'type $(Build.ArtifactStagingDirectory)\test.txt'
displayName: 'Command Line Script'
結果:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.