From 3522ac61fe967ed1ae8bd091345a67980e4ece6f Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 31 Mar 2022 13:14:55 +0800 Subject: [PATCH] [ci] Add azure pipeline to build common libs. (#10367) Why I did it To remove reference on Azure.sonic-buildimage artifacts. Azure.sonic-buildimage has a higher failure rate. --- .azure-pipelines/build-commonlib.yml | 19 ++++++++++++++ .azure-pipelines/template-commonlib.yml | 34 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .azure-pipelines/build-commonlib.yml create mode 100644 .azure-pipelines/template-commonlib.yml diff --git a/.azure-pipelines/build-commonlib.yml b/.azure-pipelines/build-commonlib.yml new file mode 100644 index 000000000000..df9bcb25ae70 --- /dev/null +++ b/.azure-pipelines/build-commonlib.yml @@ -0,0 +1,19 @@ +pr: none +trigger: none +schedules: +- cron: "0 0 * * *" + displayName: Daily build + branches: + include: + - master + - 202??? +resources: + repositories: + - repository: buildimage + type: github + name: Azure/sonic-buildimage + ref: master + endpoint: build + +jobs: +- template: .azure-pipelines/template-commonlib.yml@buildimage diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml new file mode 100644 index 000000000000..0e42cb4e17ac --- /dev/null +++ b/.azure-pipelines/template-commonlib.yml @@ -0,0 +1,34 @@ +jobs: +- job: Build + timeoutInMinutes: 120 + pool: sonicbld + steps: + - checkout: self + clean: true + submodules: recursive + - script: | + set -ex + case $(Build.SourceBranchName) in + 202012 | 202106) + bldenv=buster + ;; + *) + bldenv=bullseye + ;; + esac + BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y + echo "##vso[task.setvariable variable=bldenv;]$bldenv" + 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 + + 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) + displayName: Make common lib packages + - publish: $(Build.ArtifactStagingDirectory) + artifact: common-lib