From 16bfb1456129dd54af73a1889affbf46a147edb2 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Thu, 31 Mar 2022 13:22:48 +0800 Subject: [PATCH 1/4] [ci] Fix docker-sonic-slave-template issue for resources. --- .azure-pipelines/docker-sonic-slave-arm64.yml | 7 +++++++ .azure-pipelines/docker-sonic-slave-armhf.yml | 7 +++++++ .azure-pipelines/docker-sonic-slave-template.yml | 8 -------- .azure-pipelines/docker-sonic-slave.yml | 7 +++++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-arm64.yml b/.azure-pipelines/docker-sonic-slave-arm64.yml index 6bb9203b49ae..2a9af06c3d01 100644 --- a/.azure-pipelines/docker-sonic-slave-arm64.yml +++ b/.azure-pipelines/docker-sonic-slave-arm64.yml @@ -3,6 +3,13 @@ # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml # Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64 +resources: + repositories: + - repository: buildimage + type: github + name: Azure/sonic-buildimage + ref: master + endpoint: build schedules: - cron: "0 8 * * *" diff --git a/.azure-pipelines/docker-sonic-slave-armhf.yml b/.azure-pipelines/docker-sonic-slave-armhf.yml index 250bf7400a69..69e73479f342 100644 --- a/.azure-pipelines/docker-sonic-slave-armhf.yml +++ b/.azure-pipelines/docker-sonic-slave-armhf.yml @@ -3,6 +3,13 @@ # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml # Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64 +resources: + repositories: + - repository: buildimage + type: github + name: Azure/sonic-buildimage + ref: master + endpoint: build schedules: - cron: "0 8 * * *" diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 40a937a8c89a..6b4b90f371d9 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -3,14 +3,6 @@ # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml # Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64 -resources: - repositories: - - repository: buildimage - type: github - name: Azure/sonic-buildimage - ref: master - endpoint: build - parameters: - name: arch type: string diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index bf5fce77a722..7416fa51cf21 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -3,6 +3,13 @@ # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml # Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64 +resources: + repositories: + - repository: buildimage + type: github + name: Azure/sonic-buildimage + ref: master + endpoint: build schedules: - cron: "0 8 * * *" From f4fe461fb45caf94e69a0dbd210f9eb835479b8a Mon Sep 17 00:00:00 2001 From: shilongliu Date: Thu, 31 Mar 2022 15:44:52 +0800 Subject: [PATCH 2/4] fix --- .azure-pipelines/docker-sonic-slave.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 7416fa51cf21..81f27340bb5d 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -58,10 +58,17 @@ stages: - stage: Build jobs: - ${{ each dist in parameters.dists }}: - - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - - ${{ each arch in parameters.arches }}: + ${{ if endswith(variables['Build.DefinitionName'], dist) }}: + ${{ each arch in parameters.arches }}: + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - template: docker-sonic-slave-template.yml parameters: pool: sonicbld arch: ${{ arch }} dist: ${{ dist }} + ${{ else }}: + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + parameters: + pool: sonicbld + arch: ${{ arch }} + dist: ${{ dist }} From 2aefc3ea9e7092a57f0e8c23a99daa3d5fa779c1 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Thu, 31 Mar 2022 15:47:24 +0800 Subject: [PATCH 3/4] fix --- .azure-pipelines/docker-sonic-slave.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 81f27340bb5d..2d1bde37ee3b 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -58,8 +58,8 @@ stages: - stage: Build jobs: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: + - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: + - ${{ each arch in parameters.arches }}: ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - template: docker-sonic-slave-template.yml parameters: From 91e10085232d9d5e916513bf7727727eabc89e52 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Fri, 1 Apr 2022 14:30:19 +0800 Subject: [PATCH 4/4] fix --- .azure-pipelines/docker-sonic-slave.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 2d1bde37ee3b..8af6b8b3834f 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -60,7 +60,7 @@ stages: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}: - template: docker-sonic-slave-template.yml parameters: pool: sonicbld