Skip to content

Commit

Permalink
Switch testPipeline from variable to parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Oct 22, 2020
1 parent 6e68cae commit d1ec733
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 35 deletions.
16 changes: 9 additions & 7 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
ServiceDirectory: ''
TestPipeline: false
BeforePublishSteps: []
TestMarkArgument: ''
BuildTargetingString: 'azure-*'
Expand Down Expand Up @@ -119,13 +120,14 @@ jobs:
vmImage: '$(OSVmImage)'

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

- pwsh: |
$toxenvvar = "whl,sdist"
Expand Down
17 changes: 10 additions & 7 deletions eng/pipelines/templates/stages/archetype-python-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
Artifacts: []
TestPipeline: false
ArtifactName: 'not-specified'
DependsOn: Build
DocArtifact: 'documentation'
Expand Down Expand Up @@ -28,13 +29,14 @@ stages:
deploy:
steps:
- checkout: self
- 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
- template: /eng/pipelines/templates/steps/stage-filtered-artifacts.yml
parameters:
SourceFolder: ${{parameters.ArtifactName}}
Expand Down Expand Up @@ -193,6 +195,7 @@ stages:
DocRepoDestinationPath: 'docs-ref-services/'
GHReviewersVariable: 'OwningGHUser'
CIConfigs: $(CIConfigs)
CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}'

- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- deployment: UpdatePackageVersion
Expand Down
29 changes: 17 additions & 12 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ parameters:
- name: Artifacts
type: object
default: []
- name: TestPipeline
type: boolean
default: false
- name: ServiceDirectory
type: string
default: not-specified
Expand Down Expand Up @@ -35,23 +38,25 @@ stages:
jobs:
- template: ../jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: ${{parameters.ServiceDirectory}}
ToxEnvParallel: ${{parameters.ToxEnvParallel}}
BuildDocs: ${{parameters.BuildDocs}}
InjectedPackages: ${{parameters.InjectedPackages}}
SkipPythonVersion: ${{parameters.SkipPythonVersion}}
AdditionalTestMatrix: ${{parameters.AdditionalTestMatrix}}
DevFeedName: ${{parameters.DevFeedName}}
ServiceDirectory: ${{ parameters.ServiceDirectory }}
TestPipeline: ${{ parameters.TestPipeline }}
ToxEnvParallel: ${{ parameters.ToxEnvParallel }}
BuildDocs: ${{ parameters.BuildDocs }}
InjectedPackages: ${{ parameters.InjectedPackages }}
SkipPythonVersion: ${{ parameters.SkipPythonVersion }}
AdditionalTestMatrix: ${{ parameters.AdditionalTestMatrix }}
DevFeedName: ${{ parameters.DevFeedName }}

# The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch.
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
- template: archetype-python-release.yml
parameters:
DependsOn: Build
ServiceDirectory: ${{parameters.ServiceDirectory}}
Artifacts: ${{parameters.Artifacts}}
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
ArtifactName: packages
DocArtifact: documentation
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
DevFeedName: ${{parameters.DevFeedName}}
TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }}
TargetDocRepoName: ${{ parameters.TargetDocRepoName }}
DevFeedName: ${{ parameters.DevFeedName }}
15 changes: 8 additions & 7 deletions eng/pipelines/templates/steps/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ parameters:
BuildDocs: true

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"
Expand Down
4 changes: 2 additions & 2 deletions sdk/template/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ trigger:
paths:
include:
- sdk/template/
- eng/common/

pr:
branches:
Expand All @@ -28,6 +27,7 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: template
TestPipeline: true
Artifacts:
- name: azure_template
safeName: azuretemplate
safeName: azuretemplate

0 comments on commit d1ec733

Please sign in to comment.