dotnet-docker icon indicating copy to clipboard operation
dotnet-docker copied to clipboard

Allow Set-DotNetVersions script to read from config.json for .NET releases

Open lbussell opened this issue 11 months ago • 3 comments

Describe the Problem

Manually looking up the product versions to release and typing them in/copying them to the commandline takes time and is error-prone.

Describe the Solution

The .NET Release staging pipeline outputs a file called config.json that contains the .NET versions in the build. It looks like this:

{
  "Channel": "8.0",
  "Release": "8.0.3",
  "Runtime": "8.0.3",
  "Asp": "8.0.3",
  "Sdks": [
    "8.0.202",
    "8.0.103"
  ],
  ...
  "Runtime_Build": "8.0.3-servicing.24114.23",
  "Asp_Build": "8.0.3-servicing.24116.15",
  "Sdk_Builds": [
    "8.0.202-servicing.24116.49",
    "8.0.103-servicing.24116.48"
  ],
  ...
}

We should be able to read from this file in order to set the correct .NET versions for a release.

Ideally, we could also connect directly to Azure DevOps. I would like to be able to give Set-DotNetVersions.ps1 a build number and have it update everything automatically.

lbussell avatar Mar 21 '24 17:03 lbussell

[Triage] This would be a good gradual step towards release automation and simplify the release process for .NET container images.

lbussell avatar Mar 21 '24 18:03 lbussell

Here's one way to get the config.json file using the az CLI -

PS> az pipelines runs artifact download --organization https://dev.azure.com/dnceng/ --project internal --run-id $buildId --path . --artifact-name drop

lbussell avatar Apr 05 '24 22:04 lbussell

I wrote a prototype script that accomplishes this (locally). It takes an AzDo build ID and calls Set-DotnetVersions.ps1: https://gist.github.com/lbussell/4a1ee1e552e7db69fccbfd359e14984f#file-set-dotnetversionsfrombuild-ps1

lbussell avatar Apr 06 '24 00:04 lbussell

Completed with https://github.com/dotnet/dotnet-docker/pull/5496

lbussell avatar Jul 15 '24 17:07 lbussell