-
Register an Azure account
-
Create a new organization on Azure DevOps
- Organization settings
- Security
- Policies
- Security policies
- Allow public projects: ON
- Security policies
- Policies
- General
- Overview
- Time zone
- UTC+07:00
- Time zone
- Extensions
- Browse marketplace
- Extensions for Azure DevOps
- Trigger Build Task by Benj Huser
- Extensions for Azure DevOps
- Browse marketplace
- Overview
- Pipelines
- Agent pools
- Add pool
- sonicbld
- sonicbld-armhf
- sonicbld-arm64
- sonictest
- sonictest-ma
- sonictest-sonic-t0
- sonictest-t1-lag
- ubuntu-20.04
- Add pool
- Agent pools
- Security
- Organization settings
-
Set up self-hosted agents
- Follow the instructions here: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops
- use a proxy for curl
curl -x "$PROXY"
when downloading Azure Pipelines Agent - add
sudo
to list of installed packages
- use a proxy for curl
- Set up agents for pools:
- sonicbld
- sonicbld-armhf
- Follow the instructions here: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops
-
Create a GitHub personal access token for Azure Pipelines
- Settings
- Developer settings
- Personal access tokens
- Fine-grained tokens
- Generate new token
- Token name:
azure-pipelines
- Expiration: 90 days or custom for 1 year
- Resource owner: [github organization]
- Repository access: Public Repositories (read-only)
- Token name:
- Generate new token
- Fine-grained tokens
- Personal access tokens
- Developer settings
- Settings
-
Create a new project
sonic-build
in the organization- Project settings
- General
- Overview
- Visibility
- Public
- Visibility
- Overview
- Pipelines
- Service connections
- New service connection
- Choose a service or connection type: GitHub
- Authentication method: Personal Access Token
- Service connection name:
sonic-net
- Security: [x] Grant access permission to all pipelines
- New service connection
- Choose a service or connection type: Docker Registry
- Docker Registry: XXX
- Docker ID: XXX
- DOcker Password: XXX
- Service connection name:
sonicdev
- Security: [x] Grant access permission to all pipelines
- New service connection
- Service connections
- General
- Project settings
-
Create a new pipeline in the project
- Pipelines
- Library
-
- Variable group
- Properties
- Variable group name: Testbed-Tools
- Variables
- VAR: ''
- Properties
- Variable group
-
- Pipelines
- New pipeline
- Connect: GitHub
- Select: XXX/sonic-buildimage
- Configure: Existing Azure Pipelines YAML file
- Branch:
202211
- Path:
/azure-pipelines.yml
- Branch:
- Review: Save
- New pipeline
- Connect: GitHub
- Select: XXX/sonic-buildimage
- Configure: Existing Azure Pipelines YAML file
- Branch:
master
- Path:
./azure-pipelines/docker-sonic-slave.yml
- Branch:
- Review: Save
XXX.sonic-buildimage (1)
- Rename:
XXX.docker-slave-stretch
- Rename:
- New pipeline
- Library
- Pipelines
-
Run the pipelines
- XXX.docker-slave-stretch
- Run pipeline
- Branch/tag:
master
- registry_url: pcr.my.id
- Branch/tag:
- Run pipeline
- XXX.sonic-buildimage
- Run pipeline
- Branch/tag:
202211
- Resources
- sonic-net/sonic-buildimage:
202211
- sonic-net/sonic-mgmt:
master
- sonic-net/sonic-buildimage:
- Branch/tag:
- Run pipeline
- XXX.docker-slave-stretch
Notes:
-
Install marketplace extension Trigger Build Task by Benj Huser
This provides the
TriggerBuild@4
task. Searching forTriggerBuild
on the marketplace doesn't yield any results. I had to search forTrigger Build
. -
When running pipeline
-
branch:
202211
-
give permission to access Queue
sonicbld-armhf
##[error]No agent found in pool sonicbld-armhf which satisfies the specified demands: Agent.Version -gtVersion 2.199
need to install agent for sonincbld-armhf
-
missing sudo command in agent docker
-
-
Set up a private docker registry: https://docs.docker.com/registry/deploying/