Skip to content

Commit

Permalink
Switch from testpipeline variable to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Oct 22, 2020
1 parent 0a606b6 commit 1546549
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
17 changes: 10 additions & 7 deletions eng/pipelines/templates/stages/archetype-js-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,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/common/pipelines/templates/steps/verify-changelog.yml
parameters:
PackageName: ${{artifact.name}}
Expand Down Expand Up @@ -131,6 +132,7 @@ stages:
DocRepoDestinationPath: 'docs-ref-services/'
GHReviewersVariable: 'OwningGHUser'
CIConfigs: $(CIConfigs)
CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}'

- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- deployment: PublishDocsGitHubIO
Expand Down Expand Up @@ -205,6 +207,7 @@ stages:
PRBranchName: increment-package-version-${{ parameters.ServiceDirectory }}-$(Build.BuildId)
CommitMsg: "Increment package version after release of ${{ artifact.name }}"
PRTitle: "Increment version for ${{ parameters.ServiceDirectory }} releases"
CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}'

- stage: Integration
dependsOn: ${{parameters.DependsOn}}
Expand Down
15 changes: 10 additions & 5 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 All @@ -23,17 +26,19 @@ stages:
jobs:
- template: ../jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: ${{parameters.ServiceDirectory}}
Artifacts: ${{parameters.Artifacts}}
RunUnitTests: ${{parameters.RunUnitTests}}
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
RunUnitTests: ${{ parameters.RunUnitTests }}

# 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'), eq(parameters.IncludeRelease,true))}}:
- template: archetype-js-release.yml
parameters:
DependsOn: Build
ServiceDirectory: ${{parameters.ServiceDirectory}}
Artifacts: ${{parameters.Artifacts}}
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
ArtifactName: packages
TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }}
TargetDocRepoName: ${{ parameters.TargetDocRepoName }}
15 changes: 8 additions & 7 deletions eng/pipelines/templates/steps/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ parameters:
ServiceDirectory: not-specified

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: |
$folder = "${{parameters.ServiceDirectory}}"
Expand Down
2 changes: 1 addition & 1 deletion sdk/template/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ trigger:
paths:
include:
- sdk/template/
- eng/common/

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

0 comments on commit 1546549

Please sign in to comment.