Skip to content

Commit

Permalink
CI: add azure pipeline CI/CD (sonic-net#754)
Browse files Browse the repository at this point in the history
* CI: add azure pipeline CI/CD

Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan authored Dec 19, 2020
1 parent a3095b8 commit 754849a
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .artifactignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*
!*.deb
73 changes: 73 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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

trigger:
branches:
include:
- "*"

pool:
vmImage: 'ubuntu-latest'

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

steps:
- script: |
sudo apt-get install -qq -y \
qtbase5-dev \
libdbus-glib-1-2 \
libdbus-glib-1-dev \
libpcsclite-dev \
docbook-to-man \
docbook-utils \
aspell-en \
libhiredis0.14 \
libhiredis-dev \
libnl-3-dev \
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
libnl-cli-3-dev \
swig3.0 \
libpython2.7-dev \
libzmq5 libzmq3-dev \
libboost-all-dev
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
sudo apt-get install -y rsyslog
sudo service rsyslog start
displayName: "Install dependencies"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 9
artifacts: sonic-swss-common
displayName: "Download sonic swss common deb packages"
- script: |
sudo dpkg -i sonic-swss-common/libswsscommon_1.0.0_amd64.deb
sudo dpkg -i sonic-swss-common/libswsscommon-dev_1.0.0_amd64.deb
workingDirectory: $(Pipeline.Workspace)
displayName: "Install sonic swss Common"
- checkout: self
submodules: true
- script: |
./autogen.sh
fakeroot dpkg-buildpackage -b -us -uc -Tbinary-syncd-vs
cp ../*.deb .
displayName: "Compile sonic sairedis"
- script: |
make check
displayName: "Run sonic sairedis unit tests"
- publish: $(System.DefaultWorkingDirectory)/
artifact: sonic-sairedis
displayName: "Archive sonic sairedis debian packages"

0 comments on commit 754849a

Please sign in to comment.