Skip to content

Commit

Permalink
[ci]: Support azp for cisco 8000 (#8654)
Browse files Browse the repository at this point in the history
Why I did it
Setup Azure pipeline for cisco 8000.
  • Loading branch information
xumia authored and qiluo-msft committed Oct 12, 2021
1 parent c71a263 commit 63037a2
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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)
Expand Down
64 changes: 64 additions & 0 deletions .azure-pipelines/official-build-cisco-8000.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 63037a2

Please sign in to comment.