[ci]: get build logs when build fails (#7219)

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
lguohan 2021-04-03 09:28:56 -07:00 committed by GitHub
parent 38258acda3
commit 9fa5a6135c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,3 +114,12 @@ jobs:
- publish: $(System.DefaultWorkingDirectory)/
artifact: sonic-buildimage.${{ parameters.platform }}
displayName: "Archive sonic image"
- script: |
set -x
find target -name "*.log" | xargs -I{} cp {} $(Build.ArtifactStagingDirectory)/
condition: failed()
displayName: "Copy build logs"
- publish: $(Build.ArtifactStagingDirectory)/
artifact: sonic-buildimage.${{ parameters.platform}}.logs@$(System.JobAttempt)
displayName: "Archive build logs"
condition: failed()