Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Set default ACR in UpgrateVersion/PR/official pipeline. #10341

Merged
merged 9 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .azure-pipelines/azure-pipelines-UpgrateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ parameters:
stages:
- stage: Build
variables:
CACHE_MODE: none
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS='
- name: CACHE_MODE
value: none
- name: VERSION_CONTROL_OPTIONS
value: 'SONIC_VERSION_CONTROL_COMPONENTS='
- template: .azure-pipelines/template-variables.yml@buildimage
jobs:
- template: azure-pipelines-build.yml
parameters:
Expand Down
5 changes: 4 additions & 1 deletion .azure-pipelines/docker-sonic-slave-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
pool: ${{ parameters.pool }}
steps:
- template: cleanup.yml
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: template-clean-sonic-slave.yml
- ${{ else }}:
- template: .azure-pipelines/template-variables.yml@buildimage
- checkout: self
clean: true
submodules: recursive
Expand Down
11 changes: 11 additions & 0 deletions .azure-pipelines/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,20 @@ schedules:
- 201911
- 201811

resources:
repositories:
- repository: buildimage
type: github
name: Azure/sonic-buildimage
ref: master
endpoint: build

trigger: none
pr: none

variables:
- template: .azure-pipelines/template-variables.yml@buildimage

stages:
- stage: Build
pool: sonicbld
Expand Down
4 changes: 3 additions & 1 deletion .azure-pipelines/template-clean-sonic-slave.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
steps:
- script: |
containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }')
set -x
containers=$(docker container ls -aq)
[ -n "$containers" ] && docker container rm -f $containers
docker images | grep "^<none>" | awk '{print$3}' | xargs -i docker rmi {}
images=$(docker images 'sonic-slave-*' -a -q)
[ -n "$images" ] && docker rmi -f $images
exit 0
displayName: 'Cleanup sonic slave'
2 changes: 2 additions & 0 deletions .azure-pipelines/template-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
variables:
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'
9 changes: 9 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ resources:
type: github
name: Azure/sonic-mgmt
endpoint: build
- repository: buildimage
type: github
name: Azure/sonic-buildimage
endpoint: build
ref: master

variables:
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: .azure-pipelines/template-variables.yml
- ${{ else }}:
- template: .azure-pipelines/template-variables.yml@buildimage
- name: CACHE_MODE
value: rcache

Expand Down