-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Download PMC Packages through TemplateContext
#27326
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1809471
Switch from DownloadArtifacts to TemplateContext for EV2
ccb6bfa
Add Test Production parameters in tempaltes
bc657d3
Change stage names based on release env
8a45b26
Skip ev2 push
4892b5d
Remove pwsh logging
e64bcc0
Capture artifacts in pipeline.workspace
2340d76
User forward slashes
92f60eb
template context drops the artifact folder name
74ce346
Change back to backslashes
807c779
Remove PowerShell from credscan
616fb50
remove PowerShell from tsa file path
b6f62ba
Add TSA to release prep template
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,56 @@ | ||
| parameters: | ||
| - name: releaseEnvironment | ||
| type: string | ||
| default: Production | ||
| values: | ||
| - Production | ||
| - PPE | ||
| - Test | ||
| - name: approvalServiceEnvironment | ||
| type: string | ||
| default: Production | ||
| values: | ||
| - Production | ||
| - PPE | ||
| - Test | ||
| # OneBranch requires the stage name to be prefixed with the release environment. | ||
| # Official uses 'Prod' for Production; NonProd validators require '<env>' (e.g. 'Test', 'PPE'). | ||
| - name: stagePrefix | ||
| type: string | ||
| default: Prod | ||
| # When true, the Ev2 push step is skipped. Useful for NonOfficial dry-runs that | ||
| # only want to validate artifact download via templateContext.inputs. | ||
| - name: skipEv2Push | ||
| type: boolean | ||
| default: false | ||
|
|
||
| stages: | ||
| - stage: 'Prod_Release' | ||
| - stage: ${{ parameters.stagePrefix }}_Release | ||
| displayName: 'Deploy packages to PMC with EV2' | ||
| dependsOn: | ||
| - PrepForEV2 | ||
| variables: | ||
| - name: ob_release_environment | ||
| value: "Production" | ||
| value: ${{ parameters.releaseEnvironment }} | ||
| - name: repoRoot | ||
| value: $(Build.SourcesDirectory) | ||
| jobs: | ||
| - job: Prod_ReleaseJob | ||
| - job: ${{ parameters.stagePrefix }}_ReleaseJob | ||
| displayName: Publish to PMC | ||
| pool: | ||
| type: release | ||
|
|
||
| steps: | ||
| - task: DownloadPipelineArtifact@2 | ||
| templateContext: | ||
| inputs: | ||
| targetPath: '$(Pipeline.Workspace)' | ||
| artifact: drop_PrepForEV2_CopyEv2FilesToArtifact | ||
| displayName: 'Download drop_PrepForEV2_CopyEv2FilesToArtifact artifact that has all files needed' | ||
| - input: pipelineArtifact | ||
| artifactName: drop_PrepForEV2_CopyEv2FilesToArtifact | ||
|
|
||
| - task: DownloadPipelineArtifact@2 | ||
| inputs: | ||
| buildType: 'current' | ||
| targetPath: '$(Pipeline.Workspace)' | ||
| displayName: 'Download to get EV2 Files' | ||
|
|
||
| - task: vsrm-ev2.vss-services-ev2.adm-release-task.ExpressV2Internal@1 | ||
| displayName: 'Ev2: Push to PMC' | ||
| inputs: | ||
| UseServerMonitorTask: true | ||
| EndpointProviderType: ApprovalService | ||
| ApprovalServiceEnvironment: Production | ||
| ServiceRootPath: '$(Pipeline.Workspace)/drop_PrepForEV2_CopyEV2FilesToArtifact/EV2Specs/ServiceGroupRoot' | ||
| RolloutSpecPath: '$(Pipeline.Workspace)/drop_PrepForEV2_CopyEV2FilesToArtifact/EV2Specs/ServiceGroupRoot/RolloutSpec.json' | ||
| steps: | ||
| - ${{ if not(parameters.skipEv2Push) }}: | ||
| - task: vsrm-ev2.vss-services-ev2.adm-release-task.ExpressV2Internal@1 | ||
| displayName: 'Ev2: Push to PMC' | ||
| inputs: | ||
| UseServerMonitorTask: true | ||
| EndpointProviderType: ApprovalService | ||
| ApprovalServiceEnvironment: ${{ parameters.approvalServiceEnvironment }} | ||
| ServiceRootPath: '$(Pipeline.Workspace)/EV2Specs/ServiceGroupRoot' | ||
| RolloutSpecPath: '$(Pipeline.Workspace)/EV2Specs/ServiceGroupRoot/RolloutSpec.json' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stagePrefixandreleaseEnvironmentcan be set inconsistently (e.g.,releaseEnvironment: PPEbut leavingstagePrefixat defaultProd), which would produce a stage name that doesn't match the actual release environment and can fail OneBranch environment/stage-name validation. Consider deriving the stage prefix fromreleaseEnvironmentinside the template (e.g., mapProduction -> Prod, else use the environment name) so callers only need to setreleaseEnvironment(and optionally override if there’s a true exception).