Skip to content

Commit 8c37f1a

Browse files
authored
Initial contents for 1.2.2 release. (microsoft#1)
Initial contents for 1.2.2 release.
1 parent 1d9019b commit 8c37f1a

19 files changed

+638
-1
lines changed

2.2/alpine3.8/amd64/Dockerfile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine3.8
2+
3+
# Install Visual Studio Snapshot Debugger prerequisites
4+
RUN apk update \
5+
&& apk add libxml2 libuuid libunwind
6+
7+
# Install Visual Studio Snapshot Debugger
8+
ARG VSSNAPSHOTDEBUGGER_VERSION=1.2.2
9+
ARG VSSNAPSHOTDEBUGGER_SHA512=2e74a03fb244fb2378f7841d4615f69976ee4af6d5943037d57dc0b3e643bccae6f14b1ac884862040ae70975387586d12861ff2b8520574f2568f12d82b1876
10+
RUN wget -O vssnapshotdebugger.tar.gz "https://aka.ms/vssnapshotdebugger/release/${VSSNAPSHOTDEBUGGER_VERSION}/vssnapshotdebugger-${VSSNAPSHOTDEBUGGER_VERSION}-linux-musl-x64.tar.gz" \
11+
&& echo "${VSSNAPSHOTDEBUGGER_SHA512} vssnapshotdebugger.tar.gz" | sha512sum -c - \
12+
&& mkdir -p /diag \
13+
&& tar -pzxf vssnapshotdebugger.tar.gz -C /diag \
14+
&& rm vssnapshotdebugger.tar.gz
15+
16+
# Set environment variables to load Visual Studio Snapshot Debugger into .NET Core applications
17+
ENV CORECLR_ENABLE_PROFILING=1
18+
ENV CORECLR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
19+
ENV CORECLR_PROFILER_PATH_64=/diag/Instrumentation64/libInstrumentationEngine.so
20+
ENV MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
21+
ENV MicrosoftInstrumentationEngine_HostPath_64=/diag/Instrumentation64/libMicrosoftExtensionsHost.so
22+
ENV MicrosoftInstrumentationEngine_FileLog=Errors
23+
ENV MicrosoftInstrumentationEngine_FileLogPath=/tmp/diag/log.txt
24+
25+
# Install Visual Studio Debugger script prerequisites
26+
RUN apk add bash unzip
27+
28+
# Install Visual Studio Debugger
29+
ARG GETVSDBG_SHA512=fe76c7671951d2c0ba254c76d3fd7dc9f90cd329457e89bd277f099904b416578a6346d2b8e5d686f7e7f66463e8830e886cf869ef2d95b5a229324c6e15a649
30+
RUN wget -O getvsdbg.sh "https://aka.ms/vssnapshotdebugger/preview/getvsdbgsh" \
31+
&& echo "${GETVSDBG_SHA512} getvsdbg.sh" | sha512sum -c - \
32+
&& bash ./getvsdbg.sh -v latest -l /diag/vsdbg \
33+
&& rm getvsdbg.sh

2.2/bionic/amd64/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM microsoft/dotnet:2.2-aspnetcore-runtime-bionic
2+
3+
# Install Visual Studio Snapshot Debugger prerequisites
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends \
6+
curl libxml2 uuid libunwind8
7+
8+
# Install Visual Studio Snapshot Debugger
9+
ARG VSSNAPSHOTDEBUGGER_VERSION=1.2.2
10+
ARG VSSNAPSHOTDEBUGGER_SHA512=a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44
11+
RUN curl -SL --output vssnapshotdebugger.tar.gz "https://aka.ms/vssnapshotdebugger/release/${VSSNAPSHOTDEBUGGER_VERSION}/vssnapshotdebugger-${VSSNAPSHOTDEBUGGER_VERSION}-linux-x64.tar.gz" \
12+
&& echo "${VSSNAPSHOTDEBUGGER_SHA512} vssnapshotdebugger.tar.gz" | sha512sum -c - \
13+
&& mkdir -p /diag \
14+
&& tar -pzxf vssnapshotdebugger.tar.gz -C /diag \
15+
&& rm vssnapshotdebugger.tar.gz
16+
17+
# Set environment variables to load Visual Studio Snapshot Debugger into .NET Core applications
18+
ENV CORECLR_ENABLE_PROFILING=1
19+
ENV CORECLR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
20+
ENV CORECLR_PROFILER_PATH_64=/diag/Instrumentation64/libInstrumentationEngine.so
21+
ENV MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
22+
ENV MicrosoftInstrumentationEngine_HostPath_64=/diag/Instrumentation64/libMicrosoftExtensionsHost.so
23+
ENV MicrosoftInstrumentationEngine_FileLog=Errors
24+
ENV MicrosoftInstrumentationEngine_FileLogPath=/tmp/diag/log.txt
25+
26+
# Install Visual Studio Debugger script prerequisites
27+
RUN apt-get install -y --no-install-recommends \
28+
bash unzip
29+
30+
# Install Visual Studio Debugger
31+
ARG GETVSDBG_SHA512=fe76c7671951d2c0ba254c76d3fd7dc9f90cd329457e89bd277f099904b416578a6346d2b8e5d686f7e7f66463e8830e886cf869ef2d95b5a229324c6e15a649
32+
RUN curl -SL --output getvsdbg.sh "https://aka.ms/vssnapshotdebugger/preview/getvsdbgsh" \
33+
&& echo "${GETVSDBG_SHA512} getvsdbg.sh" | sha512sum -c - \
34+
&& bash ./getvsdbg.sh -v latest -l /diag/vsdbg \
35+
&& rm getvsdbg.sh
36+
37+
# Remove package lists to save space; can be restored with 'apt-get update'
38+
RUN rm -rf /var/lib/apt/lists/*

2.2/stretch-slim/amd64/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM microsoft/dotnet:2.2-aspnetcore-runtime-stretch-slim
2+
3+
# Install Visual Studio Snapshot Debugger prerequisites
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends \
6+
curl libxml2 uuid libunwind8
7+
8+
# Install Visual Studio Snapshot Debugger
9+
ARG VSSNAPSHOTDEBUGGER_VERSION=1.2.2
10+
ARG VSSNAPSHOTDEBUGGER_SHA512=a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44
11+
RUN curl -SL --output vssnapshotdebugger.tar.gz "https://aka.ms/vssnapshotdebugger/release/${VSSNAPSHOTDEBUGGER_VERSION}/vssnapshotdebugger-${VSSNAPSHOTDEBUGGER_VERSION}-linux-x64.tar.gz" \
12+
&& echo "${VSSNAPSHOTDEBUGGER_SHA512} vssnapshotdebugger.tar.gz" | sha512sum -c - \
13+
&& mkdir -p /diag \
14+
&& tar -pzxf vssnapshotdebugger.tar.gz -C /diag \
15+
&& rm vssnapshotdebugger.tar.gz
16+
17+
# Set environment variables to load Visual Studio Snapshot Debugger into .NET Core applications
18+
ENV CORECLR_ENABLE_PROFILING=1
19+
ENV CORECLR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
20+
ENV CORECLR_PROFILER_PATH_64=/diag/Instrumentation64/libInstrumentationEngine.so
21+
ENV MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
22+
ENV MicrosoftInstrumentationEngine_HostPath_64=/diag/Instrumentation64/libMicrosoftExtensionsHost.so
23+
ENV MicrosoftInstrumentationEngine_FileLog=Errors
24+
ENV MicrosoftInstrumentationEngine_FileLogPath=/tmp/diag/log.txt
25+
26+
# Install Visual Studio Debugger script prerequisites
27+
RUN apt-get install -y --no-install-recommends \
28+
bash unzip
29+
30+
# Install Visual Studio Debugger
31+
ARG GETVSDBG_SHA512=fe76c7671951d2c0ba254c76d3fd7dc9f90cd329457e89bd277f099904b416578a6346d2b8e5d686f7e7f66463e8830e886cf869ef2d95b5a229324c6e15a649
32+
RUN curl -SL --output getvsdbg.sh "https://aka.ms/vssnapshotdebugger/preview/getvsdbgsh" \
33+
&& echo "${GETVSDBG_SHA512} getvsdbg.sh" | sha512sum -c - \
34+
&& bash ./getvsdbg.sh -v latest -l /diag/vsdbg \
35+
&& rm getvsdbg.sh
36+
37+
# Remove package lists to save space; can be restored with 'apt-get update'
38+
RUN rm -rf /var/lib/apt/lists/*

CHECKSUMS

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Version: 1.2.2
2+
Hash: SHA512
3+
4+
a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44 vssnapshotdebugger-1.2.2-linux-x64.tar.gz
5+
2e74a03fb244fb2378f7841d4615f69976ee4af6d5943037d57dc0b3e643bccae6f14b1ac884862040ae70975387586d12861ff2b8520574f2568f12d82b1876 vssnapshotdebugger-1.2.2-linux-musl-x64.tar.gz
6+
7+
Version: 1.2.1
8+
Hash: SHA512
9+
10+
2de7cd4bd39f6d9ddd171b831ae66b51e37db9b4f609e1748b5eed122215fbfd7e787bb1834a5f2d1e3c6dbdc619094fb49db6d4e0d4af5f71cdcd69d5a17930 vssnapshotdebugger-1.2.1-linux-x64.tar.gz
11+
2fc3f1c3bacfc7185ad3d415c0145928fed8fb91480fdce2951dabe0e4a3e028a636715d1337f1dc58c23b5d9e83dc5bdc83cbe68e576b3105d5a22b52bdea9f vssnapshotdebugger-1.2.1-linux-musl-x64.tar.gz

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Microsoft/vs-ide-production-diagnostics

README.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
1+
[//]: # (WARNING! This is a file that is automatically generated from the /templates/README.md.template file.)
2+
[//]: # (DO NOT edit the README.md file directly, otherwise its contents will be automatically overwritten from the template.)
3+
[//]: # (Any intended change to the README.md file must be made in the /templates/README.md.template file.)
14

2-
# Contributing
5+
# Visual Studio Snapshot Debugger Docker Images
6+
7+
This repository contains Dockerfiles that demonstrate how to set up the Visual Studio Snapshot Debugger on Docker images.
8+
9+
## What is the Visual Studio Snapshot Debugger?
10+
11+
The Visual Studio Snapshot Debugger is a feature of Visual Studio that allows you to take snapshots and to create log statements of in-production ASP.NET Azure
12+
applications without interupting them. Please see https://aka.ms/snappoint for more infomration regarding the Visual Studio Snapshot Debugger.
13+
14+
## Dockerfiles
15+
16+
The Dockerfiles are organized according to the ASP.NET Core major and minor version, the OS platform, and the platform architecture.
17+
For example, the ASP.NET Core 2.2 Alpine 3.8 x64 Dockerfile is located at /2.2/alpine/amd64/Dockerfile. When built, this Dockerfile produces
18+
an image with Alpine 3.8 x64 as the base with ASP.NET Core 2.2 Runtime and the latest supported Snapshot Debugger backend package.
19+
20+
The Dockerfiles do not take a dependency on the Docker build context, thus they can be built without specifying a build context when executing "docker build".
21+
22+
## Latest Release
23+
24+
### Version: 1.2.2
25+
File Name | Description
26+
:---------|:-----------
27+
[vssnapshotdebugger-1.2.2-linux-x64.tar.gz](https://aka.ms/vssnapshotdebugger/release/1.2.2/vssnapshotdebugger-1.2.2-linux-x64.tar.gz) | For glibc based OS - most common
28+
[vssnapshotdebugger-1.2.2-linux-musl-x64.tar.gz](https://aka.ms/vssnapshotdebugger/release/1.2.2/vssnapshotdebugger-1.2.2-linux-musl-x64.tar.gz) | For musl based OS, such as Alpine Linux
29+
30+
### Additional Information
31+
32+
- See [releases](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/RELEASES.md) for information about any current or previous release.
33+
- See [checksums](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/CHECKSUMS) for checksum information for individual files in each release.
34+
35+
## Contributing
336

437
This project welcomes contributions and suggestions. Most contributions require you to agree to a
538
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
@@ -12,3 +45,21 @@ provided by the bot. You will only need to do this once across all repos using o
1245
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
1346
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
1447
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
48+
49+
## Developing
50+
51+
1. Clone this repository to your local machine.
52+
2. Run init.cmd or init.ps1, found in the root of the repository.
53+
54+
This initialization script installs local Git hooks to automatically run update scripts when commits are made,
55+
for example, the CHECKSUMS, README.md, and RELEASES.md files are updated automatically when a change is made to
56+
the releases.json file.
57+
58+
## Issues
59+
60+
If you have any problems with or questions about this repository, please contact us through a
61+
[GitHub issue](https://github.com/microsoft/vssnapshotdebugger-docker/issues).
62+
63+
## Licenses
64+
65+
- [Repository License](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/LICENSE)

RELEASES.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[//]: # (WARNING! This is a file that is automatically generated from the /templates/RELEASES.md.template file.)
2+
[//]: # (DO NOT edit the RELEASES.md file directly, otherwise its contents will be automatically overwritten from the template.)
3+
[//]: # (Any intended change to the RELEASES.md file must be made in the /templates/RELEASES.md.template file.)
4+
5+
# Releases
6+
7+
See [checksums](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/CHECKSUMS) for checksum information for individual files in each release.
8+
9+
## Latest Release
10+
11+
### Version: 1.2.2
12+
File Name | Description
13+
:---------|:-----------
14+
[vssnapshotdebugger-1.2.2-linux-x64.tar.gz](https://aka.ms/vssnapshotdebugger/release/1.2.2/vssnapshotdebugger-1.2.2-linux-x64.tar.gz) | For glibc based OS - most common
15+
[vssnapshotdebugger-1.2.2-linux-musl-x64.tar.gz](https://aka.ms/vssnapshotdebugger/release/1.2.2/vssnapshotdebugger-1.2.2-linux-musl-x64.tar.gz) | For musl based OS, such as Alpine Linux
16+
17+
## Previous Releases
18+
19+
### Version: 1.2.1
20+
File Name | Description
21+
:---------|:-----------
22+
[vssnapshotdebugger-1.2.1-linux-x64.tar.gz](https://aka.ms/vssnapshotdebugger/release/1.2.1/vssnapshotdebugger-1.2.1-linux-x64.tar.gz) | For glibc based OS - most common
23+
[vssnapshotdebugger-1.2.1-linux-musl-x64.tar.gz](https://aka.ms/vssnapshotdebugger/release/1.2.1/vssnapshotdebugger-1.2.1-linux-musl-x64.tar.gz) | For musl based OS, such as Alpine Linux

init.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@ECHO OFF
2+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0init.ps1" %*
3+
EXIT /B %ERRORLEVEL%

init.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Create a pre-commit hook if one does not already exist.
2+
# This hook is generic and it invokes the real hook script at scripts\hooks\pre-commit.ps1
3+
$repositoryRoot=$PSScriptRoot
4+
$preCommitPath="$repositoryRoot\.git\hooks\pre-commit"
5+
if (!(Test-Path "$preCommitPath")) {
6+
Copy-Item -Path "$repositoryRoot\scripts\hooks\pre-commit" -Destination "$preCommitPath"
7+
}

releases.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"releases": [{
3+
"version": "1.2.1",
4+
"files": [{
5+
"name": "vssnapshotdebugger-${Version}-linux-x64.tar.gz",
6+
"description": "For glibc based OS - most common",
7+
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-x64.tar.gz",
8+
"sha512": "2de7cd4bd39f6d9ddd171b831ae66b51e37db9b4f609e1748b5eed122215fbfd7e787bb1834a5f2d1e3c6dbdc619094fb49db6d4e0d4af5f71cdcd69d5a17930"
9+
},{
10+
"name": "vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
11+
"description": "For musl based OS, such as Alpine Linux",
12+
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
13+
"sha512": "2fc3f1c3bacfc7185ad3d415c0145928fed8fb91480fdce2951dabe0e4a3e028a636715d1337f1dc58c23b5d9e83dc5bdc83cbe68e576b3105d5a22b52bdea9f"
14+
}]
15+
},{
16+
"version": "1.2.2",
17+
"files": [{
18+
"name": "vssnapshotdebugger-${Version}-linux-x64.tar.gz",
19+
"description": "For glibc based OS - most common",
20+
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-x64.tar.gz",
21+
"sha512": "a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44"
22+
},{
23+
"name": "vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
24+
"description": "For musl based OS, such as Alpine Linux",
25+
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
26+
"sha512": "2e74a03fb244fb2378f7841d4615f69976ee4af6d5943037d57dc0b3e643bccae6f14b1ac884862040ae70975387586d12861ff2b8520574f2568f12d82b1876"
27+
}]
28+
}]
29+
}

scripts/Common.psm1

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
function Get-ReleaseTable() {
3+
param(
4+
[Parameter(Mandatory = $true)]
5+
[ValidateNotNull()]
6+
[PSCustomObject] $Release,
7+
8+
[Parameter(Mandatory = $false)]
9+
[Int32] $HeaderSize = 0
10+
)
11+
12+
$tableBuilder = New-Object -TypeName System.Text.StringBuilder
13+
if ($HeaderSize -gt 0) {
14+
[void]$tableBuilder.Append('#' * $HeaderSize)
15+
[void]$tableBuilder.Append(' ')
16+
}
17+
[void]$tableBuilder.Append('Version: ')
18+
[void]$tableBuilder.AppendLine($Release.version)
19+
[void]$tableBuilder.AppendLine('File Name | Description')
20+
[void]$tableBuilder.AppendLine(':---------|:-----------')
21+
22+
$rowsBuilder = New-Object -TypeName System.Text.StringBuilder
23+
$Release.files | ForEach-Object {
24+
$releaseFile = $_
25+
26+
if ($rowsBuilder.Length -gt 0) {
27+
[void]$rowsBuilder.AppendLine()
28+
}
29+
30+
$fileName = Format-ReleaseTokens -Value $releaseFile.name -Version $Release.version
31+
[void]$rowsBuilder.Append('[')
32+
[void]$rowsBuilder.Append($fileName)
33+
[void]$rowsBuilder.Append(']')
34+
35+
$fileUri = Format-ReleaseTokens -Value $releaseFile.uri -Version $Release.version
36+
[void]$rowsBuilder.Append('(')
37+
[void]$rowsBuilder.Append($fileUri)
38+
[void]$rowsBuilder.Append(')')
39+
40+
[void]$rowsBuilder.Append(' | ')
41+
[void]$rowsBuilder.Append($releaseFile.description)
42+
}
43+
[void]$tableBuilder.Append($rowsBuilder.ToString())
44+
45+
return $tableBuilder.ToString()
46+
}
47+
48+
function Format-ReleaseTokens() {
49+
param(
50+
[Parameter(Mandatory = $true)]
51+
[ValidateNotNullOrEmpty()]
52+
[string] $Value,
53+
54+
[Parameter(Mandatory = $true)]
55+
[ValidateNotNullOrEmpty()]
56+
[string] $Version
57+
)
58+
59+
return $Value.Replace('${Version}', $Version)
60+
}
61+
62+
function Get-ReleaseData() {
63+
$releasesPath = Join-Path -Path (Get-RepositoryRoot) -ChildPath "releases.json" -Resolve
64+
return (Get-Content -Path $releasesPath -Raw | ConvertFrom-Json).releases
65+
}
66+
67+
function Get-RepositoryRoot() {
68+
return Resolve-Path -Path "$PSScriptRoot\.."
69+
}
70+
71+
function Set-ContentAndStage() {
72+
param(
73+
[Parameter(Mandatory = $true)]
74+
[ValidateNotNullOrEmpty()]
75+
[string] $Path,
76+
77+
[Parameter(Mandatory = $true)]
78+
[ValidateNotNullOrEmpty()]
79+
[string] $Content,
80+
81+
[Parameter(Mandatory = $false)]
82+
[ValidateNotNullOrEmpty()]
83+
[switch] $Stage
84+
)
85+
86+
[System.IO.File]::WriteAllText($Path, $Content)
87+
88+
if ($Stage) {
89+
& git add $Path
90+
}
91+
}

scripts/UpdateChecksums.ps1

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
param(
2+
[Parameter(Mandatory = $false)]
3+
[switch] $StageChanges
4+
)
5+
6+
$ErrorActionPreference = 'Stop'
7+
$VerbosePreference = 'Continue'
8+
9+
Import-Module "$PSScriptRoot\Common.psm1" -Force -Verbose:$false
10+
11+
$repositoryRoot = Get-RepositoryRoot
12+
13+
$builder = New-Object -TypeName System.Text.StringBuilder
14+
15+
# Write checksums groups by release version descending.
16+
Get-ReleaseData | Sort-Object -Property "version" -Descending | ForEach-Object {
17+
$release = $_
18+
19+
if ($builder.Length -gt 0) {
20+
[void]$builder.AppendLine();
21+
}
22+
23+
# Add two lines for the version and the hash algorithm
24+
$version = $release.version
25+
[void]$builder.Append('Version: ')
26+
[void]$builder.AppendLine($version)
27+
[void]$builder.AppendLine('Hash: SHA512')
28+
[void]$builder.AppendLine();
29+
30+
# Add a line for each release file.
31+
# Each of these lines can be copy-and-pasted directly into scripts for checksum verification
32+
# since the sha512sum executable verifies the checksum in the format "<checksum> <filename>".
33+
$release.files | ForEach-Object {
34+
$releaseFile = $_
35+
# Write checksum value
36+
[void]$builder.Append($releaseFile.sha512)
37+
38+
# Two spaces is intentional
39+
[void]$builder.Append(' ')
40+
41+
# Write file name
42+
$releaseFileName = Format-ReleaseTokens -Value $releaseFile.name -Version $release.version
43+
[void]$builder.AppendLine($releaseFilename)
44+
}
45+
}
46+
47+
Set-ContentAndStage -Path "$repositoryRoot\CHECKSUMS" -Content $builder.ToString() -Stage:$StageChanges

0 commit comments

Comments
 (0)