2021-10-08 02:31:49 -05:00
|
|
|
# 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
|
|
|
|
|
|
|
|
schedules:
|
|
|
|
- cron: "0 8 * * *"
|
|
|
|
displayName: Daily midnight build
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
- 202012
|
|
|
|
always: true
|
|
|
|
|
|
|
|
trigger: none
|
|
|
|
pr: none
|
|
|
|
|
|
|
|
resources:
|
|
|
|
repositories:
|
|
|
|
- repository: cisco-8000
|
|
|
|
type: github
|
|
|
|
name: Cisco-8000-sonic/platform-cisco-8000
|
|
|
|
endpoint: cisco-connection
|
|
|
|
|
2022-04-20 23:13:09 -05:00
|
|
|
|
2022-03-07 20:15:52 -06:00
|
|
|
variables:
|
|
|
|
- group: SONIC-AKV-STROAGE-1
|
|
|
|
- name: StorageSASKey
|
|
|
|
value: $(sonicstorage-SasToken)
|
2022-04-20 23:13:09 -05:00
|
|
|
- name: SONIC_ENABLE_SECUREBOOT_SIGNATURE
|
|
|
|
value: y
|
|
|
|
- name: SIGNING_KEY
|
|
|
|
value: /etc/certificates/sonic-secure-boot-private.pem
|
|
|
|
- name: SIGNING_CERT
|
|
|
|
value: $(Build.StagingDirectory)/target/sonic-secure-boot-public.pem
|
2022-03-07 20:15:52 -06:00
|
|
|
|
2021-10-08 02:31:49 -05:00
|
|
|
stages:
|
|
|
|
- stage: Build
|
|
|
|
pool: sonic
|
|
|
|
variables:
|
|
|
|
CACHE_MODE: wcache
|
|
|
|
SKIP_CHECKOUT: true
|
|
|
|
TERM: ''
|
2022-03-07 20:15:52 -06:00
|
|
|
PACKAGE_URL: "https://sonicstorage.blob.core.windows.net/packages"
|
2021-10-08 02:31:49 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
- template: azure-pipelines-build.yml
|
|
|
|
parameters:
|
|
|
|
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
|
|
|
|
preSteps:
|
2022-04-20 23:13:09 -05:00
|
|
|
- template: azure-pipelines-download-certificate.yml
|
2021-10-08 02:31:49 -05:00
|
|
|
- checkout: self
|
|
|
|
submodules: recursive
|
|
|
|
path: s
|
|
|
|
displayName: 'Checkout code'
|
|
|
|
- checkout: cisco-8000
|
|
|
|
submodules: recursive
|
|
|
|
path: s/platform/cisco-8000
|
|
|
|
displayName: 'Checkout cisco-8000'
|
|
|
|
- script: |
|
2021-10-14 01:14:27 -05:00
|
|
|
cisco_ref=$(cat platform/checkout/cisco-8000.ini | grep '^ref=' | cut -d= -f2)
|
2021-10-08 02:31:49 -05:00
|
|
|
echo "The cisco 8000 release version is $cisco_ref"
|
|
|
|
echo "##vso[task.setvariable variable=cisco.ref]$cisco_ref"
|
|
|
|
displayName: 'Export cisco release version'
|
|
|
|
- task: DownloadGitHubRelease@0
|
|
|
|
inputs:
|
|
|
|
connection: cisco-connection
|
|
|
|
userRepository: Cisco-8000-sonic/platform-cisco-8000
|
|
|
|
defaultVersionType: specificTag
|
|
|
|
version: $(cisco.ref)
|
|
|
|
itemPattern: 'artifactory-*.tar.gz'
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)'
|
|
|
|
- script: |
|
|
|
|
make PLATFORM=cisco-8000 platform/cisco-8000
|
|
|
|
tar xfz $(System.ArtifactsDirectory)/artifactory-*.tar.gz -C platform/cisco-8000
|
|
|
|
displayName: 'Setup cisco artifacts'
|
2022-03-07 20:15:52 -06:00
|
|
|
- script: |
|
|
|
|
set -ex
|
|
|
|
filename=$(find platform/cisco-8000/artifactory/sonic -name cisco-* -type f | head -n 1)
|
|
|
|
if [ -z "$filename" ]; then
|
|
|
|
echo "Cisco sai package not found" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
cd $(dirname $filename)
|
|
|
|
echo "PWD=$(pwd)"
|
2022-07-27 11:58:04 -05:00
|
|
|
ls -l cisco-*.deb
|
2022-03-07 20:15:52 -06:00
|
|
|
while read -r package; do
|
|
|
|
# Cisco version format: <VERSION>-sai-<sai-ver>-<distribution>-<COMMIT HASH>
|
|
|
|
# The <sai-ver> may contain several values in one build, the part is skipped when publishing to storage
|
|
|
|
# See https://github.com/Cisco-8000-sonic/sdk/blob/master/azure-pipelines.yml
|
|
|
|
# The $PACKAGE_URL is only accessible for AZP
|
|
|
|
version=$(echo $package | awk -F_ '{print $(NF-1)}' | cut -d- -f1,2,4,5)
|
|
|
|
package_url="$PACKAGE_URL/sai/ciscosai/master/$version/$package"
|
|
|
|
echo "Override package $package from $package_url"
|
|
|
|
wget "$package_url$StorageSASKey" -O "$package"
|
2022-07-27 11:58:04 -05:00
|
|
|
done < <(ls cisco-*.deb)
|
2022-03-07 20:15:52 -06:00
|
|
|
env:
|
|
|
|
StorageSASKey: $(StorageSASKey)
|
|
|
|
condition: ne(variables['Build.Reason'], 'PullRequest')
|
|
|
|
displayName: "Override cisco sai packages"
|
2022-04-20 23:13:09 -05:00
|
|
|
- script: |
|
|
|
|
echo "SONIC_ENABLE_SECUREBOOT_SIGNATURE := y" >> rules/config.user
|
|
|
|
echo "SIGNING_KEY := $(SIGNING_KEY)" >> rules/config.user
|
|
|
|
echo "SIGNING_CERT := $(SIGNING_CERT)" >> rules/config.user
|
|
|
|
displayName: "Enable secure boot signature"
|
2021-10-08 02:31:49 -05:00
|
|
|
jobGroups:
|
|
|
|
- name: cisco-8000
|