Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
[ci]: setup proper azp (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <[email protected]>
  • Loading branch information
lguohan authored Apr 4, 2021
1 parent 5d82051 commit 33acd5b
Showing 1 changed file with 67 additions and 7 deletions.
74 changes: 67 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

pool: sonicbld

trigger:
branches:
include:
Expand All @@ -15,23 +13,85 @@ pr:
include:
- master

resources:
repositories:
- repository: sonic-mgmt-common
type: github
name: Azure/sonic-mgmt-common
endpoint: build

stages:
- stage: Build
jobs:
- job:
displayName: "build"
timeoutInMinutes: 60

pool:
vmImage: ubuntu-20.04

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest

steps:
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'

- checkout: sonic-mgmt-common
clean: true
submodules: recursive
displayName: 'Checkout code'

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 127
artifact: sonic-mgmt-common
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic-mgmt-common"

- script: |
echo Hello
# the following is copied from jenkins
# set -ex
# ./scripts/common/sonic-telemetry-build/build.sh
- publish: $(System.DefaultWorkingDirectory)/target/python-wheels/
# REDIS
sudo apt-get install -y redis-server
sudo sed -ri 's/^# unixsocket/unixsocket/' /etc/redis/redis.conf
sudo sed -ri 's/^unixsocketperm .../unixsocketperm 777/' /etc/redis/redis.conf
sudo sed -ri 's/redis-server.sock/redis.sock/' /etc/redis/redis.conf
sudo service redis-server start
# LIBYANG
sudo dpkg -i ../target/debs/buster/libyang*1.0.73*.deb
displayName: "Install dependency"
- script: |
set -ex
ls -l
pushd sonic-mgmt-common
NO_TEST_BINS=1 dpkg-buildpackage -rfakeroot -b -us -uc
popd
pushd sonic-telemetry
dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc) && cp ../*.deb $(Build.ArtifactStagingDirectory)/
displayName: "Build"
- publish: $(Build.ArtifactStagingDirectory)/
artifact: sonic-telemetry
displayName: "Archive artifacts"

0 comments on commit 33acd5b

Please sign in to comment.