From 796112a3c62477de3946e85cd407ad8e36bbe2d3 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Fri, 15 Apr 2022 10:58:52 +0800 Subject: [PATCH 1/6] fix --- .azure-pipelines/template-commonlib.yml | 32 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index 0e42cb4e17ac..e5488ab7c18d 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -10,25 +10,35 @@ jobs: set -ex case $(Build.SourceBranchName) in 202012 | 202106) - bldenv=buster + bldenvs="buster" ;; *) - bldenv=bullseye + bldenvs="buster bullseye" ;; esac - BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y - echo "##vso[task.setvariable variable=bldenv;]$bldenv" + for bldenv in $bldenvs + do + BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y + done + set +x + echo "##vso[task.setvariable variable=bldenvs;]$bldenvs" displayName: Make configure - script: | set -ex - LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}') - LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/") - BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y + for bldenv in $(bldenvs) + do + LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}') + LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/") + SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y - LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}') - LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/") - BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libyang_${LIBYANG_VERSION}_amd64.deb - find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory) + LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}') + LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/") + SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libyang_${LIBYANG_VERSION}_amd64.deb + + mkdir $(Build.ArtifactStagingDirectory)/$bldenv + find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory)/$bldenv/ + find target -name *.log | xargs -i cp {} $(Build.ArtifactStagingDirectory)/$bldenv/ + done displayName: Make common lib packages - publish: $(Build.ArtifactStagingDirectory) artifact: common-lib From 17b330f15f7a558fe849ffb82796cc173ef659d5 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Fri, 15 Apr 2022 13:50:07 +0800 Subject: [PATCH 2/6] fix --- .azure-pipelines/template-commonlib.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index e5488ab7c18d..9d3ee8ad3f8a 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -34,11 +34,8 @@ jobs: LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}') LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/") SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libyang_${LIBYANG_VERSION}_amd64.deb - - mkdir $(Build.ArtifactStagingDirectory)/$bldenv - find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory)/$bldenv/ - find target -name *.log | xargs -i cp {} $(Build.ArtifactStagingDirectory)/$bldenv/ done + mv target $(Build.ArtifactStagingDirectory) displayName: Make common lib packages - publish: $(Build.ArtifactStagingDirectory) artifact: common-lib From 855353bbde9ea60073169a13bc36ff8094a17e0a Mon Sep 17 00:00:00 2001 From: shilongliu Date: Mon, 18 Apr 2022 13:17:44 +0800 Subject: [PATCH 3/6] fix --- .azure-pipelines/template-commonlib.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index 9d3ee8ad3f8a..6d894cf6fb7c 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -8,14 +8,7 @@ jobs: submodules: recursive - script: | set -ex - case $(Build.SourceBranchName) in - 202012 | 202106) - bldenvs="buster" - ;; - *) - bldenvs="buster bullseye" - ;; - esac + lbdenvs=${!$(Build.SourceBranchName)} for bldenv in $bldenvs do BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y From 8d954ff981effbfb912d33f0b58c2919ac1c8933 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Mon, 18 Apr 2022 14:00:26 +0800 Subject: [PATCH 4/6] fix --- .azure-pipelines/template-commonlib.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index 6d894cf6fb7c..f27e48ec37bc 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -8,7 +8,10 @@ jobs: submodules: recursive - script: | set -ex - lbdenvs=${!$(Build.SourceBranchName)} + branch=$(Build.SourceBranchName) + # DIST_MASTER is set in variable. + BRANCH=DIST_${branch^^} + bldenvs=${!BRANCH} for bldenv in $bldenvs do BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y From 1a13127e4dd1601bbded8e83fefc5c163c7c3f9a Mon Sep 17 00:00:00 2001 From: shilongliu Date: Mon, 18 Apr 2022 14:25:45 +0800 Subject: [PATCH 5/6] fix --- .azure-pipelines/template-commonlib.yml | 3 +++ .azure-pipelines/template-variables.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index f27e48ec37bc..5b870ff31303 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -2,6 +2,8 @@ jobs: - job: Build timeoutInMinutes: 120 pool: sonicbld + variables: + - template: template-variables.yml steps: - checkout: self clean: true @@ -12,6 +14,7 @@ jobs: # DIST_MASTER is set in variable. BRANCH=DIST_${branch^^} bldenvs=${!BRANCH} + [ "$bldenvs" == "" ] && bldenvs=$(COMMON_LIB_BUILD_ENVS) for bldenv in $bldenvs do BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y diff --git a/.azure-pipelines/template-variables.yml b/.azure-pipelines/template-variables.yml index f28768e39efe..a6813d242908 100644 --- a/.azure-pipelines/template-variables.yml +++ b/.azure-pipelines/template-variables.yml @@ -1,2 +1,3 @@ variables: DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io' + COMMON_LIB_BUILD_ENVS: 'buster bullseye' From 20a01102c036e3001c34b76b952dfbbd45d6186a Mon Sep 17 00:00:00 2001 From: shilongliu Date: Mon, 18 Apr 2022 14:34:10 +0800 Subject: [PATCH 6/6] version 1.0 --- .azure-pipelines/template-commonlib.yml | 2 +- .azure-pipelines/template-variables.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index 5b870ff31303..61a801e3f526 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -14,7 +14,7 @@ jobs: # DIST_MASTER is set in variable. BRANCH=DIST_${branch^^} bldenvs=${!BRANCH} - [ "$bldenvs" == "" ] && bldenvs=$(COMMON_LIB_BUILD_ENVS) + [ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)" for bldenv in $bldenvs do BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y diff --git a/.azure-pipelines/template-variables.yml b/.azure-pipelines/template-variables.yml index a6813d242908..9f192d35bd5e 100644 --- a/.azure-pipelines/template-variables.yml +++ b/.azure-pipelines/template-variables.yml @@ -1,3 +1,3 @@ variables: DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io' - COMMON_LIB_BUILD_ENVS: 'buster bullseye' + COMMON_LIB_BUILD_ENVS: 'bullseye'