[ci] Add arm artifacts in common lib azure pipeline (#10817)
* [ci] Add arm artifacts in common lib azure pipeline
This commit is contained in:
parent
392899682f
commit
b313563986
@ -1,40 +1,53 @@
|
|||||||
jobs:
|
parameters:
|
||||||
- job: Build
|
- name: archs
|
||||||
timeoutInMinutes: 120
|
type: object
|
||||||
pool: sonicbld
|
default:
|
||||||
variables:
|
- amd64
|
||||||
- template: template-variables.yml
|
- armhf
|
||||||
steps:
|
- arm64
|
||||||
- checkout: self
|
|
||||||
clean: true
|
|
||||||
submodules: recursive
|
|
||||||
- script: |
|
|
||||||
set -ex
|
|
||||||
branch=$(Build.SourceBranchName)
|
|
||||||
# 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
|
|
||||||
done
|
|
||||||
set +x
|
|
||||||
echo "##vso[task.setvariable variable=bldenvs;]$bldenvs"
|
|
||||||
displayName: Make configure
|
|
||||||
- script: |
|
|
||||||
set -ex
|
|
||||||
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}')
|
jobs:
|
||||||
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/")
|
- ${{ each arch in parameters.archs }}:
|
||||||
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libyang_${LIBYANG_VERSION}_amd64.deb
|
- job: Build_${{ arch }}
|
||||||
done
|
timeoutInMinutes: 120
|
||||||
mv target $(Build.ArtifactStagingDirectory)
|
${{ if eq(arch,'amd64') }}:
|
||||||
displayName: Make common lib packages
|
pool: sonicbld
|
||||||
- publish: $(Build.ArtifactStagingDirectory)
|
${{ else }}:
|
||||||
artifact: common-lib
|
pool: sonicbld-${{ arch }}
|
||||||
|
variables:
|
||||||
|
- template: template-variables.yml
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
clean: true
|
||||||
|
submodules: recursive
|
||||||
|
- script: |
|
||||||
|
set -ex
|
||||||
|
branch=$(Build.SourceBranchName)
|
||||||
|
# replace all: '-' -> '_'
|
||||||
|
branch=${branch//-/_}
|
||||||
|
# replace all: 'a' -> 'A', DIST_MASTER is set in variable.
|
||||||
|
BRANCH=DIST_${branch^^}
|
||||||
|
# variable name is dynamic
|
||||||
|
bldenvs=${!BRANCH}
|
||||||
|
[ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)"
|
||||||
|
for bldenv in $bldenvs
|
||||||
|
do
|
||||||
|
BLDENV=$bldenv make -f Makefile.work configure PLATFORM_ARCH=${{ arch }} PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
|
||||||
|
done
|
||||||
|
set +x
|
||||||
|
echo "##vso[task.setvariable variable=bldenvs;]$bldenvs"
|
||||||
|
displayName: Make configure
|
||||||
|
- script: |
|
||||||
|
set -ex
|
||||||
|
for bldenv in $(bldenvs)
|
||||||
|
do
|
||||||
|
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work lib-packages ENABLE_DOCKER_BASE_PULL=y
|
||||||
|
done
|
||||||
|
mv target $(Build.ArtifactStagingDirectory)
|
||||||
|
displayName: Make common lib packages
|
||||||
|
- ${{ if eq(arch,'amd64') }}:
|
||||||
|
- publish: $(Build.ArtifactStagingDirectory)
|
||||||
|
artifact: common-lib
|
||||||
|
- ${{ else }}:
|
||||||
|
- publish: $(Build.ArtifactStagingDirectory)
|
||||||
|
artifact: common-lib.${{ arch }}
|
||||||
|
4
slave.mk
4
slave.mk
@ -1377,3 +1377,7 @@ jessie : $$(addprefix $(TARGET_PATH)/,$$(JESSIE_DOCKER_IMAGES)) \
|
|||||||
.PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_STDEB_DEBS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure
|
.PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_STDEB_DEBS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure
|
||||||
|
|
||||||
.INTERMEDIATE : $(SONIC_INSTALL_DEBS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform
|
.INTERMEDIATE : $(SONIC_INSTALL_DEBS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform
|
||||||
|
|
||||||
|
## To build some commonly used libs. Some submodules depend on these libs.
|
||||||
|
## It is used in component pipelines. For example: swss needs libnl, libyang
|
||||||
|
lib-packages: $(addprefix $(DEBS_PATH)/,$(LIBNL3) $(LIBYANG))
|
||||||
|
Loading…
Reference in New Issue
Block a user