From 14c79ee9f0b3dfb67bde3a2c364568e868a7d109 Mon Sep 17 00:00:00 2001 From: liushilongbuaa Date: Tue, 20 Apr 2021 09:17:05 +0800 Subject: [PATCH] [CI] Fix pipeline template artifacts struct bug and cleanup bug Signed-off-by: liushilongbuaa --- .../azure-pipelines-image-template.yml | 4 +++- .azure-pipelines/cleanup.yml | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .azure-pipelines/cleanup.yml diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 1e85060b45..c43836f1e3 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -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 }} diff --git a/.azure-pipelines/cleanup.yml b/.azure-pipelines/cleanup.yml new file mode 100644 index 0000000000..6569c8ed0b --- /dev/null +++ b/.azure-pipelines/cleanup.yml @@ -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"