c1971ddb3a
Changes from Bullseye slave container: * Python 2 is no longer available at all * Python 3.11 (instead of Python 3.9) * GCC 12 (instead of GCC 10) * Python ipaddr package is no longer available * OpenJDK 17 (instead of OpenJDK 11) * Remove doxygen armhf manual compilation (no longer needed) * Disable FIPS, as the FIPS binaries are currently not yet available * Install Python setuptools through Debian instead of pip * Install Python wheel through Debian instead of pip * Install Python nose through Debian instead of pip * Install Python j2cli through Debian instead of pip * Install Python pexpect through Debian instead of pip * Install Python parameterized through Debian instead of pip * Install Python pyyaml through Debian instead of pip * Install Python pyfakefs through Debian instead of pip * Install Python m2crypto through Debian instead of pip * Python pympler 1.0 (instead of 0.8) * Install Python build (as a replacement to setup.py) Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
86 lines
2.9 KiB
YAML
86 lines
2.9 KiB
YAML
# Starter pipeline
|
|
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
|
# Add steps that build, run tests, deploy, and more:
|
|
# https://aka.ms/yaml
|
|
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64
|
|
parameters:
|
|
- name: arch
|
|
type: string
|
|
values:
|
|
- amd64
|
|
- armhf
|
|
- arm64
|
|
- name: march
|
|
type: string
|
|
default: ''
|
|
- name: dist
|
|
type: string
|
|
values:
|
|
- bookworm
|
|
- bullseye
|
|
- buster
|
|
- stretch
|
|
- jessie
|
|
- name: registry_url
|
|
type: string
|
|
default: sonicdev-microsoft.azurecr.io
|
|
- name: registry_conn
|
|
type: string
|
|
default: sonicdev
|
|
- name: pool
|
|
type: string
|
|
default: sonicbld
|
|
values:
|
|
- sonicbld
|
|
- sonicbld-arm64
|
|
- sonicbld-armhf
|
|
|
|
jobs:
|
|
- job: sonic_slave_${{ parameters.dist }}${{ parameters.march }}
|
|
timeoutInMinutes: 360
|
|
variables:
|
|
- template: /.azure-pipelines/template-variables.yml@buildimage
|
|
- template: /.azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage
|
|
pool: ${{ parameters.pool }}
|
|
steps:
|
|
- template: cleanup.yml
|
|
- template: /.azure-pipelines/template-clean-sonic-slave.yml@buildimage
|
|
- checkout: self
|
|
clean: true
|
|
- task: Docker@2
|
|
displayName: Login to ACR
|
|
inputs:
|
|
command: login
|
|
containerRegistry: ${{ parameters.registry_conn }}
|
|
- bash: |
|
|
set -ex
|
|
build_options="$(VERSION_CONTROL_OPTIONS)"
|
|
image_tag=$(BLDENV=${{ parameters.dist }} make -f Makefile.work showtag $build_options PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} | grep sonic-slave | tail -n 1)
|
|
image_latest=$(echo $(echo $image_tag | awk -F: '{print$1}'):latest)
|
|
if echo ${{ parameters.pool }} | grep ${{ parameters.arch }};then
|
|
image_latest=$(echo ${image_latest} | sed 's/:/-${{ parameters.arch }}:/')
|
|
fi
|
|
image_branch=$(echo $(echo $image_latest | awk -F: '{print$1}'):$(Build.SourceBranchName))
|
|
docker rmi $image_tag || true
|
|
|
|
if [[ "$(Build.Reason)" =~ [a-zA-Z]*CI ]] && docker pull ${{ parameters.registry_url }}/${image_tag};then
|
|
exit 0
|
|
fi
|
|
|
|
DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker BLDENV=${{ parameters.dist }} make -f Makefile.work configure $build_options PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} $args || docker image ls $image_tag
|
|
if [[ "$(Build.Reason)" == "PullRequest" ]];then
|
|
exit 0
|
|
fi
|
|
|
|
docker tag ${image_tag} ${REGISTRY_SERVER}/${image_tag}
|
|
docker push ${REGISTRY_SERVER}/${image_tag}
|
|
docker tag ${image_tag} ${REGISTRY_SERVER}/${image_branch}
|
|
docker push ${REGISTRY_SERVER}/${image_branch}
|
|
if [[ "$(Build.SourceBranchName)" == "master" ]];then
|
|
docker tag ${image_tag} ${REGISTRY_SERVER}/${image_latest}
|
|
docker push ${REGISTRY_SERVER}/${image_latest}
|
|
fi
|
|
env:
|
|
REGISTRY_SERVER: ${{ parameters.registry_url }}
|
|
displayName: Build sonic-slave-${{ parameters.dist }}-${{ parameters.arch }}
|