[CI] Fix pipeline template artifacts struct bug and cleanup bug

Signed-off-by: liushilongbuaa <shilongliu@microsoft.com>
This commit is contained in:
liushilongbuaa 2021-04-20 09:17:05 +08:00 committed by Shilong Liu
parent 9930ba0df0
commit 51bc97e4fc
2 changed files with 17 additions and 1 deletions

View File

@ -45,7 +45,9 @@ jobs:
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) configure
displayName: 'Make configure'
postSteps:
- publish: $(System.DefaultWorkingDirectory)/target
- script: cp target -r $(Build.ArtifactStagingDirectory)/
displayName: Copy Artifacts
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
displayName: "Archive sonic image"
- ${{ parameters.postSteps }}

View File

@ -0,0 +1,14 @@
steps:
- script: |
if sudo [ -f /var/run/march/docker.pid ] ; then
pid=`sudo cat /var/run/march/docker.pid` ; sudo kill $pid
fi
sudo rm -f /var/run/march/docker.pid
sudo rm -rf /data/march/docker
# clean native docker build
if sudo [ -f dockerfs/var/run/docker.pid ] ; then
pid=`sudo cat dockerfs/var/run/docker.pid` ; sudo kill $pid
fi
sudo rm -rf $(ls -A1)
displayName: "Clean Workspace"