From 327679e7dcb65b0bce01b3e68bb72884e1dacb88 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Thu, 22 Oct 2020 15:32:15 -0700 Subject: [PATCH] Switch TestPipeline from variable to parameter (#16657) --- .../templates/jobs/archetype-sdk-client.yml | 16 +++++++------- .../stages/archetype-java-release.yml | 17 ++++++++------- .../templates/stages/archetype-sdk-client.yml | 21 ++++++++++++------- sdk/template/ci.yml | 2 +- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 5633937c2afae..4a9428109c381 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -1,6 +1,7 @@ parameters: SDKType: client ServiceDirectory: not-specified # Set a default that breaks in obvious ways. + TestPipeline: false Artifacts: [] AdditionalModules: [] PreTestSteps: [] @@ -53,13 +54,14 @@ jobs: ArtifactName: 'packages' steps: - - task: PowerShell@2 - displayName: Prep template pipeline for release - condition: and(succeeded(),eq(variables['TestPipeline'],'true')) - inputs: - pwsh: true - workingDirectory: $(Build.SourcesDirectory) - filePath: eng/scripts/SetTestPipelineVersion.ps1 + - ${{if eq(parameters.TestPipeline, 'true')}}: + - task: PowerShell@2 + displayName: Prep template pipeline for release + condition: succeeded() + inputs: + pwsh: true + workingDirectory: $(Build.SourcesDirectory) + filePath: eng/scripts/SetTestPipelineVersion.ps1 - script: | echo "##vso[build.addbuildtag]Scheduled" diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index 9dac55291ca6d..7b9048ce10963 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -1,5 +1,6 @@ parameters: Artifacts: [] + TestPipeline: false ArtifactName: 'not-specified' TargetDocRepoOwner: '' TargetDocRepoName: '' @@ -61,13 +62,14 @@ stages: vmImage: ubuntu-18.04 steps: - - task: PowerShell@2 - displayName: Prep template pipeline for release - condition: and(succeeded(),eq(variables['TestPipeline'],'true')) - inputs: - pwsh: true - workingDirectory: $(Build.SourcesDirectory) - filePath: eng/scripts/SetTestPipelineVersion.ps1 + - ${{if eq(parameters.TestPipeline, 'true')}}: + - task: PowerShell@2 + displayName: Prep template pipeline for release + condition: succeeded() + inputs: + pwsh: true + workingDirectory: $(Build.SourcesDirectory) + filePath: eng/scripts/SetTestPipelineVersion.ps1 - task: UsePythonVersion@0 displayName: 'Use Python 3.6' @@ -185,6 +187,7 @@ stages: DocRepoDestinationPath: 'docs-ref-services/' GHReviewersVariable: 'OwningGHUser' CIConfigs: $(CIConfigs) + CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}' - ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}: - deployment: PublishDocs diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 4d6c4e37fda7b..27afc9cbe2db0 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -9,6 +9,9 @@ parameters: - name: Artifacts type: object default: [] +- name: TestPipeline + type: boolean + default: false - name: AdditionalModules type: object default: [] @@ -30,9 +33,10 @@ stages: jobs: - template: ../jobs/archetype-sdk-client.yml parameters: - ServiceDirectory: ${{parameters.ServiceDirectory}} - SDKType: ${{parameters.SDKType}} - Artifacts: ${{parameters.Artifacts}} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + TestPipeline: ${{ parameters.TestPipeline }} + SDKType: ${{ parameters.SDKType }} + Artifacts: ${{ parameters.Artifacts }} AdditionalModules: ${{ parameters.AdditionalModules }} # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. @@ -40,10 +44,11 @@ stages: - template: archetype-java-release.yml parameters: DependsOn: Build - ServiceDirectory: ${{parameters.ServiceDirectory}} - SDKType: ${{parameters.SDKType}} - Artifacts: ${{parameters.Artifacts}} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + SDKType: ${{ parameters.SDKType }} + Artifacts: ${{ parameters.Artifacts }} + TestPipeline: ${{ parameters.TestPipeline }} ArtifactName: packages - TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}} - TargetDocRepoName: ${{parameters.TargetDocRepoName}} + TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }} + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} diff --git a/sdk/template/ci.yml b/sdk/template/ci.yml index fc1e0dbf5eca3..dd134830740c2 100644 --- a/sdk/template/ci.yml +++ b/sdk/template/ci.yml @@ -9,7 +9,6 @@ trigger: paths: include: - sdk/template/ - - eng/common/ pr: branches: @@ -26,6 +25,7 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: template + TestPipeline: true Artifacts: - name: azure-sdk-template groupId: com.azure