-
Notifications
You must be signed in to change notification settings - Fork 155
Script populate yaml #803
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
Script populate yaml #803
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
param( | ||
[string] | ||
$StableVersion, | ||
|
||
[string] | ||
$PreviewVersion, | ||
|
||
[string] | ||
$LtsVersion | ||
) | ||
|
||
if (!($stableVersion -eq "")) | ||
{ | ||
if ($stableVersion -notmatch '\d+\.\d+\.\d+$') { | ||
throw "stable release tag is not for a stable build: '$stableVersion'" | ||
} | ||
} | ||
|
||
if (!($previewVersion -eq "")) | ||
{ | ||
if ($previewVersion -notmatch '\d+\.\d+\.\d+-(preview|rc)\.\d+$') { | ||
throw "preview release tag is not for a preview build: '$previewVersion'" | ||
} | ||
} | ||
|
||
if (!($ltsVersion -eq "")) | ||
{ | ||
if ($ltsVersion -notmatch '\d+\.\d+\.\d+$') { | ||
throw "lts release tag is not for a lts build: '$ltsVersion'" | ||
} | ||
} | ||
|
||
function Update-ChannelReleaseStageYaml { | ||
param( | ||
[Parameter(Mandatory)] | ||
[ValidateSet('stable', 'preview', 'lts')] | ||
[string] | ||
$Channel, | ||
|
||
[string] | ||
$Version | ||
) | ||
|
||
$toolsFolderPath = Split-Path -Parent $PSScriptRoot | ||
$repoRoot = Split-Path -Parent $toolsFolderPath | ||
$buildHelperFolderPath = Join-Path -Path $toolsFolderPath -ChildPath 'buildHelper' | ||
$buildHelperModulePath = Join-Path -Path $buildHelperFolderPath -ChildPath 'buildHelper.psm1' | ||
Import-Module $buildHelperModulePath | ||
$buildScriptPath = Join-Path -Path $repoRoot -ChildPath "build.ps1" | ||
if (!($Version -eq "")) | ||
{ | ||
Write-Verbose -Verbose "using $Channel version: $Version" | ||
if ($Channel -eq "stable") | ||
{ | ||
& $buildScriptPath -UpdateBuildYaml -Channel $Channel -StableVersion $Version -Verbose -Acr All -OsFilter All | ||
} | ||
elseif ($Channel -eq "preview") | ||
{ | ||
& $buildScriptPath -UpdateBuildYaml -Channel $Channel -PreviewVersion $Version -Verbose -Acr All -OsFilter All | ||
} | ||
else #Channel lts | ||
{ | ||
& $buildScriptPath -UpdateBuildYaml -Channel $Channel -LtsVersion $Version -Verbose -Acr All -OsFilter All | ||
} | ||
} | ||
else | ||
{ | ||
Write-Verbose -Verbose "using $Channel only" | ||
& $buildScriptPath -UpdateBuildYaml -Channel $Channel -Verbose -Acr All -OsFilter All | ||
} | ||
} | ||
|
||
|
||
# Update stableReleaseStage.yml | ||
Update-ChannelReleaseStageYaml -Channel stable -Version $stableVersion | ||
|
||
# Update previewReleaseStage.yml | ||
Update-ChannelReleaseStageYaml -Channel preview -Version $previewVersion | ||
|
||
# Update ltsReleaseStage.yml | ||
Update-ChannelReleaseStageYaml -Channel lts -Version $ltsVersion | ||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Update Build Yamls | ||
|
||
## Context | ||
|
||
This `updateBuildYamls.ps1` script needs to be run before the build pipeline for PowerShell-Docker is kicked off. Running the script will produce a channel based yaml file, like <channel>ReleaseStage.yml for each channel. Then a PR must be created with these newly added/updated yaml files as the build will rely on them. | ||
|
||
## Running the Script | ||
|
||
To update the releaseStage.yml file for all the channels, run `./updateBuildYamls.ps1 -StableVersion <stableVersion> -PreviewVersion <previewVersion> -LtsVersion <ltsVersion>`. | ||
|
||
If you want the channel versions from channels.json to be used, simply omit the -*Version parameters and run, `./updateBuildYamls.ps1`. | ||
|
||
## Notes | ||
|
||
The versions provided must match versioning syntax rules for stable and preview versions. Valid examples include 7.4.2 (stable) and v7.4.0-preview.5 (preview) |
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.
Uh oh!
There was an error while loading. Please reload this page.