[ci]: Support azp for cisco 8000 (#8654)

Why I did it
Setup Azure pipeline for cisco 8000.
This commit is contained in:
xumia 2021-10-08 15:31:49 +08:00 committed by GitHub
parent 77b6bc39be
commit 3855ce2849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 1 deletions

View File

@ -26,7 +26,7 @@ jobs:
jobVariables: ${{ parameters.jobVariables }}
preSteps:
- template: cleanup.yml
- ${{ parameters. preSteps }}
- ${{ parameters.preSteps }}
- script: |
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox)$"; then
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
@ -36,6 +36,7 @@ jobs:
displayName: "Set cache options"
- checkout: self
submodules: recursive
condition: eq(variables.SKIP_CHECKOUT, '')
displayName: 'Checkout code'
- script: |
BRANCH_NAME=$(Build.SourceBranchName)

View File

@ -0,0 +1,64 @@
# 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
stages:
- stage: Build
pool: sonic
variables:
CACHE_MODE: wcache
SKIP_CHECKOUT: true
TERM: ''
jobs:
- template: azure-pipelines-build.yml
parameters:
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
preSteps:
- checkout: self
submodules: recursive
path: s
displayName: 'Checkout code'
- checkout: cisco-8000
submodules: recursive
path: s/platform/cisco-8000
displayName: 'Checkout cisco-8000'
- script: |
cisco_ref=(cat platform/checkout/cisco-8000.ini | grep '^ref=' | cut -d= -f2)
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'
jobGroups:
- name: cisco-8000