Initial contents for 1.2.2 release. (#1)

Initial contents for 1.2.2 release.
This commit is contained in:
Justin Anderson 2018-11-13 11:18:16 -08:00 коммит произвёл GitHub
Родитель 1d9019b4fc
Коммит 8c37f1a103
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
19 изменённых файлов: 638 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,33 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine3.8
# Install Visual Studio Snapshot Debugger prerequisites
RUN apk update \
&& apk add libxml2 libuuid libunwind
# Install Visual Studio Snapshot Debugger
ARG VSSNAPSHOTDEBUGGER_VERSION=1.2.2
ARG VSSNAPSHOTDEBUGGER_SHA512=2e74a03fb244fb2378f7841d4615f69976ee4af6d5943037d57dc0b3e643bccae6f14b1ac884862040ae70975387586d12861ff2b8520574f2568f12d82b1876
RUN wget -O vssnapshotdebugger.tar.gz "https://aka.ms/vssnapshotdebugger/release/${VSSNAPSHOTDEBUGGER_VERSION}/vssnapshotdebugger-${VSSNAPSHOTDEBUGGER_VERSION}-linux-musl-x64.tar.gz" \
&& echo "${VSSNAPSHOTDEBUGGER_SHA512} vssnapshotdebugger.tar.gz" | sha512sum -c - \
&& mkdir -p /diag \
&& tar -pzxf vssnapshotdebugger.tar.gz -C /diag \
&& rm vssnapshotdebugger.tar.gz
# Set environment variables to load Visual Studio Snapshot Debugger into .NET Core applications
ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
ENV CORECLR_PROFILER_PATH_64=/diag/Instrumentation64/libInstrumentationEngine.so
ENV MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
ENV MicrosoftInstrumentationEngine_HostPath_64=/diag/Instrumentation64/libMicrosoftExtensionsHost.so
ENV MicrosoftInstrumentationEngine_FileLog=Errors
ENV MicrosoftInstrumentationEngine_FileLogPath=/tmp/diag/log.txt
# Install Visual Studio Debugger script prerequisites
RUN apk add bash unzip
# Install Visual Studio Debugger
ARG GETVSDBG_SHA512=fe76c7671951d2c0ba254c76d3fd7dc9f90cd329457e89bd277f099904b416578a6346d2b8e5d686f7e7f66463e8830e886cf869ef2d95b5a229324c6e15a649
RUN wget -O getvsdbg.sh "https://aka.ms/vssnapshotdebugger/preview/getvsdbgsh" \
&& echo "${GETVSDBG_SHA512} getvsdbg.sh" | sha512sum -c - \
&& bash ./getvsdbg.sh -v latest -l /diag/vsdbg \
&& rm getvsdbg.sh

Просмотреть файл

@ -0,0 +1,38 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime-bionic
# Install Visual Studio Snapshot Debugger prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl libxml2 uuid libunwind8
# Install Visual Studio Snapshot Debugger
ARG VSSNAPSHOTDEBUGGER_VERSION=1.2.2
ARG VSSNAPSHOTDEBUGGER_SHA512=a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44
RUN curl -SL --output vssnapshotdebugger.tar.gz "https://aka.ms/vssnapshotdebugger/release/${VSSNAPSHOTDEBUGGER_VERSION}/vssnapshotdebugger-${VSSNAPSHOTDEBUGGER_VERSION}-linux-x64.tar.gz" \
&& echo "${VSSNAPSHOTDEBUGGER_SHA512} vssnapshotdebugger.tar.gz" | sha512sum -c - \
&& mkdir -p /diag \
&& tar -pzxf vssnapshotdebugger.tar.gz -C /diag \
&& rm vssnapshotdebugger.tar.gz
# Set environment variables to load Visual Studio Snapshot Debugger into .NET Core applications
ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
ENV CORECLR_PROFILER_PATH_64=/diag/Instrumentation64/libInstrumentationEngine.so
ENV MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
ENV MicrosoftInstrumentationEngine_HostPath_64=/diag/Instrumentation64/libMicrosoftExtensionsHost.so
ENV MicrosoftInstrumentationEngine_FileLog=Errors
ENV MicrosoftInstrumentationEngine_FileLogPath=/tmp/diag/log.txt
# Install Visual Studio Debugger script prerequisites
RUN apt-get install -y --no-install-recommends \
bash unzip
# Install Visual Studio Debugger
ARG GETVSDBG_SHA512=fe76c7671951d2c0ba254c76d3fd7dc9f90cd329457e89bd277f099904b416578a6346d2b8e5d686f7e7f66463e8830e886cf869ef2d95b5a229324c6e15a649
RUN curl -SL --output getvsdbg.sh "https://aka.ms/vssnapshotdebugger/preview/getvsdbgsh" \
&& echo "${GETVSDBG_SHA512} getvsdbg.sh" | sha512sum -c - \
&& bash ./getvsdbg.sh -v latest -l /diag/vsdbg \
&& rm getvsdbg.sh
# Remove package lists to save space; can be restored with 'apt-get update'
RUN rm -rf /var/lib/apt/lists/*

Просмотреть файл

@ -0,0 +1,38 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime-stretch-slim
# Install Visual Studio Snapshot Debugger prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl libxml2 uuid libunwind8
# Install Visual Studio Snapshot Debugger
ARG VSSNAPSHOTDEBUGGER_VERSION=1.2.2
ARG VSSNAPSHOTDEBUGGER_SHA512=a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44
RUN curl -SL --output vssnapshotdebugger.tar.gz "https://aka.ms/vssnapshotdebugger/release/${VSSNAPSHOTDEBUGGER_VERSION}/vssnapshotdebugger-${VSSNAPSHOTDEBUGGER_VERSION}-linux-x64.tar.gz" \
&& echo "${VSSNAPSHOTDEBUGGER_SHA512} vssnapshotdebugger.tar.gz" | sha512sum -c - \
&& mkdir -p /diag \
&& tar -pzxf vssnapshotdebugger.tar.gz -C /diag \
&& rm vssnapshotdebugger.tar.gz
# Set environment variables to load Visual Studio Snapshot Debugger into .NET Core applications
ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
ENV CORECLR_PROFILER_PATH_64=/diag/Instrumentation64/libInstrumentationEngine.so
ENV MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
ENV MicrosoftInstrumentationEngine_HostPath_64=/diag/Instrumentation64/libMicrosoftExtensionsHost.so
ENV MicrosoftInstrumentationEngine_FileLog=Errors
ENV MicrosoftInstrumentationEngine_FileLogPath=/tmp/diag/log.txt
# Install Visual Studio Debugger script prerequisites
RUN apt-get install -y --no-install-recommends \
bash unzip
# Install Visual Studio Debugger
ARG GETVSDBG_SHA512=fe76c7671951d2c0ba254c76d3fd7dc9f90cd329457e89bd277f099904b416578a6346d2b8e5d686f7e7f66463e8830e886cf869ef2d95b5a229324c6e15a649
RUN curl -SL --output getvsdbg.sh "https://aka.ms/vssnapshotdebugger/preview/getvsdbgsh" \
&& echo "${GETVSDBG_SHA512} getvsdbg.sh" | sha512sum -c - \
&& bash ./getvsdbg.sh -v latest -l /diag/vsdbg \
&& rm getvsdbg.sh
# Remove package lists to save space; can be restored with 'apt-get update'
RUN rm -rf /var/lib/apt/lists/*

11
CHECKSUMS Normal file
Просмотреть файл

@ -0,0 +1,11 @@
Version: 1.2.2
Hash: SHA512
a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44 vssnapshotdebugger-1.2.2-linux-x64.tar.gz
2e74a03fb244fb2378f7841d4615f69976ee4af6d5943037d57dc0b3e643bccae6f14b1ac884862040ae70975387586d12861ff2b8520574f2568f12d82b1876 vssnapshotdebugger-1.2.2-linux-musl-x64.tar.gz
Version: 1.2.1
Hash: SHA512
2de7cd4bd39f6d9ddd171b831ae66b51e37db9b4f609e1748b5eed122215fbfd7e787bb1834a5f2d1e3c6dbdc619094fb49db6d4e0d4af5f71cdcd69d5a17930 vssnapshotdebugger-1.2.1-linux-x64.tar.gz
2fc3f1c3bacfc7185ad3d415c0145928fed8fb91480fdce2951dabe0e4a3e028a636715d1337f1dc58c23b5d9e83dc5bdc83cbe68e576b3105d5a22b52bdea9f vssnapshotdebugger-1.2.1-linux-musl-x64.tar.gz

1
CODEOWNERS Normal file
Просмотреть файл

@ -0,0 +1 @@
* @Microsoft/vs-ide-production-diagnostics

Просмотреть файл

@ -1,5 +1,38 @@
[//]: # (WARNING! This is a file that is automatically generated from the /templates/README.md.template file.)
[//]: # (DO NOT edit the README.md file directly, otherwise its contents will be automatically overwritten from the template.)
[//]: # (Any intended change to the README.md file must be made in the /templates/README.md.template file.)
# Contributing
# Visual Studio Snapshot Debugger Docker Images
This repository contains Dockerfiles that demonstrate how to set up the Visual Studio Snapshot Debugger on Docker images.
## What is the Visual Studio Snapshot Debugger?
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
applications without interupting them. Please see https://aka.ms/snappoint for more infomration regarding the Visual Studio Snapshot Debugger.
## Dockerfiles
The Dockerfiles are organized according to the ASP.NET Core major and minor version, the OS platform, and the platform architecture.
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
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.
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".
## Latest Release
### Version: 1.2.2
File Name | Description
:---------|:-----------
[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
[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
### Additional Information
- See [releases](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/RELEASES.md) for information about any current or previous release.
- See [checksums](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/CHECKSUMS) for checksum information for individual files in each release.
## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
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
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
## Developing
1. Clone this repository to your local machine.
2. Run init.cmd or init.ps1, found in the root of the repository.
This initialization script installs local Git hooks to automatically run update scripts when commits are made,
for example, the CHECKSUMS, README.md, and RELEASES.md files are updated automatically when a change is made to
the releases.json file.
## Issues
If you have any problems with or questions about this repository, please contact us through a
[GitHub issue](https://github.com/microsoft/vssnapshotdebugger-docker/issues).
## Licenses
- [Repository License](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/LICENSE)

23
RELEASES.md Normal file
Просмотреть файл

@ -0,0 +1,23 @@
[//]: # (WARNING! This is a file that is automatically generated from the /templates/RELEASES.md.template file.)
[//]: # (DO NOT edit the RELEASES.md file directly, otherwise its contents will be automatically overwritten from the template.)
[//]: # (Any intended change to the RELEASES.md file must be made in the /templates/RELEASES.md.template file.)
# Releases
See [checksums](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/CHECKSUMS) for checksum information for individual files in each release.
## Latest Release
### Version: 1.2.2
File Name | Description
:---------|:-----------
[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
[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
## Previous Releases
### Version: 1.2.1
File Name | Description
:---------|:-----------
[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
[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

3
init.cmd Normal file
Просмотреть файл

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

7
init.ps1 Normal file
Просмотреть файл

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

29
releases.json Normal file
Просмотреть файл

@ -0,0 +1,29 @@
{
"releases": [{
"version": "1.2.1",
"files": [{
"name": "vssnapshotdebugger-${Version}-linux-x64.tar.gz",
"description": "For glibc based OS - most common",
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-x64.tar.gz",
"sha512": "2de7cd4bd39f6d9ddd171b831ae66b51e37db9b4f609e1748b5eed122215fbfd7e787bb1834a5f2d1e3c6dbdc619094fb49db6d4e0d4af5f71cdcd69d5a17930"
},{
"name": "vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
"description": "For musl based OS, such as Alpine Linux",
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
"sha512": "2fc3f1c3bacfc7185ad3d415c0145928fed8fb91480fdce2951dabe0e4a3e028a636715d1337f1dc58c23b5d9e83dc5bdc83cbe68e576b3105d5a22b52bdea9f"
}]
},{
"version": "1.2.2",
"files": [{
"name": "vssnapshotdebugger-${Version}-linux-x64.tar.gz",
"description": "For glibc based OS - most common",
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-x64.tar.gz",
"sha512": "a46f2a6945271ce5bc4da99b6f0bb0a3d5c15de4e39ca96d8ab9c9e2ad6b89a22774f972b1b7c76de337853cef887e7ff4ca981da25a12141cb7f1c8f72c8d44"
},{
"name": "vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
"description": "For musl based OS, such as Alpine Linux",
"uri": "https://aka.ms/vssnapshotdebugger/release/${Version}/vssnapshotdebugger-${Version}-linux-musl-x64.tar.gz",
"sha512": "2e74a03fb244fb2378f7841d4615f69976ee4af6d5943037d57dc0b3e643bccae6f14b1ac884862040ae70975387586d12861ff2b8520574f2568f12d82b1876"
}]
}]
}

91
scripts/Common.psm1 Normal file
Просмотреть файл

@ -0,0 +1,91 @@
function Get-ReleaseTable() {
param(
[Parameter(Mandatory = $true)]
[ValidateNotNull()]
[PSCustomObject] $Release,
[Parameter(Mandatory = $false)]
[Int32] $HeaderSize = 0
)
$tableBuilder = New-Object -TypeName System.Text.StringBuilder
if ($HeaderSize -gt 0) {
[void]$tableBuilder.Append('#' * $HeaderSize)
[void]$tableBuilder.Append(' ')
}
[void]$tableBuilder.Append('Version: ')
[void]$tableBuilder.AppendLine($Release.version)
[void]$tableBuilder.AppendLine('File Name | Description')
[void]$tableBuilder.AppendLine(':---------|:-----------')
$rowsBuilder = New-Object -TypeName System.Text.StringBuilder
$Release.files | ForEach-Object {
$releaseFile = $_
if ($rowsBuilder.Length -gt 0) {
[void]$rowsBuilder.AppendLine()
}
$fileName = Format-ReleaseTokens -Value $releaseFile.name -Version $Release.version
[void]$rowsBuilder.Append('[')
[void]$rowsBuilder.Append($fileName)
[void]$rowsBuilder.Append(']')
$fileUri = Format-ReleaseTokens -Value $releaseFile.uri -Version $Release.version
[void]$rowsBuilder.Append('(')
[void]$rowsBuilder.Append($fileUri)
[void]$rowsBuilder.Append(')')
[void]$rowsBuilder.Append(' | ')
[void]$rowsBuilder.Append($releaseFile.description)
}
[void]$tableBuilder.Append($rowsBuilder.ToString())
return $tableBuilder.ToString()
}
function Format-ReleaseTokens() {
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $Value,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $Version
)
return $Value.Replace('${Version}', $Version)
}
function Get-ReleaseData() {
$releasesPath = Join-Path -Path (Get-RepositoryRoot) -ChildPath "releases.json" -Resolve
return (Get-Content -Path $releasesPath -Raw | ConvertFrom-Json).releases
}
function Get-RepositoryRoot() {
return Resolve-Path -Path "$PSScriptRoot\.."
}
function Set-ContentAndStage() {
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $Path,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $Content,
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[switch] $Stage
)
[System.IO.File]::WriteAllText($Path, $Content)
if ($Stage) {
& git add $Path
}
}

Просмотреть файл

@ -0,0 +1,47 @@
param(
[Parameter(Mandatory = $false)]
[switch] $StageChanges
)
$ErrorActionPreference = 'Stop'
$VerbosePreference = 'Continue'
Import-Module "$PSScriptRoot\Common.psm1" -Force -Verbose:$false
$repositoryRoot = Get-RepositoryRoot
$builder = New-Object -TypeName System.Text.StringBuilder
# Write checksums groups by release version descending.
Get-ReleaseData | Sort-Object -Property "version" -Descending | ForEach-Object {
$release = $_
if ($builder.Length -gt 0) {
[void]$builder.AppendLine();
}
# Add two lines for the version and the hash algorithm
$version = $release.version
[void]$builder.Append('Version: ')
[void]$builder.AppendLine($version)
[void]$builder.AppendLine('Hash: SHA512')
[void]$builder.AppendLine();
# Add a line for each release file.
# Each of these lines can be copy-and-pasted directly into scripts for checksum verification
# since the sha512sum executable verifies the checksum in the format "<checksum> <filename>".
$release.files | ForEach-Object {
$releaseFile = $_
# Write checksum value
[void]$builder.Append($releaseFile.sha512)
# Two spaces is intentional
[void]$builder.Append(' ')
# Write file name
$releaseFileName = Format-ReleaseTokens -Value $releaseFile.name -Version $release.version
[void]$builder.AppendLine($releaseFilename)
}
}
Set-ContentAndStage -Path "$repositoryRoot\CHECKSUMS" -Content $builder.ToString() -Stage:$StageChanges

Просмотреть файл

@ -0,0 +1,76 @@
param(
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[string] $DotNetVersion = "*.*",
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[string] $NewSnapshotDebuggerVersion = "",
[Parameter(Mandatory = $false)]
[switch] $StageChanges
)
$ErrorActionPreference = 'Stop'
$VerbosePreference = 'Continue'
Import-Module "$PSScriptRoot\Common.psm1" -Force -Verbose:$false
$ArgVersionPrefix = 'ARG VSSNAPSHOTDEBUGGER_VERSION='
$ArgVersionRegex = [regex]"$ArgVersionPrefix(?<Version>\d+\.\d+\.\d+)"
$ArgChecksumPrefix = 'ARG VSSNAPSHOTDEBUGGER_SHA512='
$ArgChecksumRegex = [regex]"$ArgChecksumPrefix[0-9a-f]{128}"
$repositoryRoot = Get-RepositoryRoot
$releases = Get-ReleaseData
Get-ChildItem -Path "$repositoryRoot\$DotNetVersion" -Include Dockerfile -Recurse | ForEach-Object {
Push-Location $repositoryRoot
$dockerfilePath = $_.FullName
$dockerfileRelativePath = Resolve-Path -Path $dockerfilePath -Relative
Pop-Location
$content = Get-Content $dockerfilePath -Raw
# Get existing Snasphot Debugger version
$versionMatch = $ArgVersionRegex.Match($content)
if (!$versionMatch.Success) {
Write-Error "Unable to determine Snapshot Debugger version in Dockerfile '$dockerfileRelativePath'."
}
$version = $versionMatch.Groups['Version'].Value
# Update Snapshot Debugger version
if ($NewSnapshotDebuggerVersion) {
Write-Verbose "Updating Snapshot Debugger version to ${NewSnapshotDebuggerVersion} in Dockerfile '$dockerfileRelativePath'."
$content = $ArgVersionRegex.Replace($content, "${ArgVersionPrefix}${NewSnapshotDebuggerVersion}")
$version = $NewSnapshotDebuggerVersion
}
# Determine which release the Dockerfile is referencing
$release = $releases | Where-Object { $_.version -eq $version } | Select-Object -First 1
if (!$release) {
Write-Error "Dockerfile '$dockerfileRelativePath' does not correspond to a release."
} elseif (!$release.files) {
Write-Error "Release ${$release.version} does not have files."
} else {
# Update information about each release file in the Dockerfile
$release.files | ForEach-Object {
$releaseFile = $_
$candidateUri = Format-ReleaseTokens -Value $releaseFile.uri -Version '${VSSNAPSHOTDEBUGGER_VERSION}'
# Check if the Dockerfile contains the release file
if ($content.Contains($candidateUri)) {
# Update the checksum value of the release file
$checksumMatch = $ArgChecksumRegex.Match($content)
if (!$checksumMatch.Success) {
Write-Error "Unable to find checksum location in Dockerfile '$dockerfileRelativePath'."
} elseif ($checksumMatch.Value -ne "${ArgChecksumPrefix}$($releaseFile.sha512)") {
Write-Verbose "Updating checksum of file '${candidateUri}' in Dockerfile '$dockerfileRelativePath'."
$content = $ArgChecksumRegex.Replace($content, "${ArgChecksumPrefix}$($releaseFile.sha512)")
}
}
}
}
Set-ContentAndStage -Path $dockerfilePath -Content $content -Stage:$StageChanges
}

Просмотреть файл

@ -0,0 +1,18 @@
param(
[Parameter(Mandatory = $false)]
[switch] $StageChanges
)
$ErrorActionPreference = 'Stop'
$VerbosePreference = 'Continue'
Import-Module "$PSScriptRoot\Common.psm1" -Force -Verbose:$false
$repositoryRoot = Get-RepositoryRoot
$readmeContent = Get-Content -Path "$repositoryRoot\templates\README.md.template" -Raw
$latestRelease = Get-ReleaseData | Sort-Object -Property "version" -Descending | Select-Object -First 1
$latestReleaseTable = Get-ReleaseTable -Release $latestRelease -HeaderSize 3
$readmeContent = $readmeContent.Replace('${LatestReleaseTable}', $latestReleaseTable)
Set-ContentAndStage -Path "$repositoryRoot\README.md" -Content $readmeContent -Stage:$StageChanges

Просмотреть файл

@ -0,0 +1,37 @@
param(
[Parameter(Mandatory = $false)]
[switch] $StageChanges
)
$ErrorActionPreference = 'Stop'
$VerbosePreference = 'Continue'
Import-Module "$PSScriptRoot\Common.psm1" -Force -Verbose:$false
$repositoryRoot = Get-RepositoryRoot
$releasesContent = Get-Content -Path "$repositoryRoot\templates\RELEASES.md.template" -Raw
$releases = Get-ReleaseData | Sort-Object -Property "version" -Descending
$latestRelease = $releases | Select-Object -First 1
$latestReleaseTable = Get-ReleaseTable -Release $latestRelease -HeaderSize 3
$releasesContent = $releasesContent.Replace('${LatestReleaseTable}', $latestReleaseTable)
$previousReleasesBuilder = New-Object -TypeName System.Text.StringBuilder
$previousReleases = @($releases | Select-Object -Skip 1)
if ($previousReleases.Count -gt 0) {
$previousReleases | ForEach-Object {
$previousRelease = $_
if ($previousReleasesBuilder.Length -gt 0) {
[void]$previousReleasesBuilder.AppendLine()
[void]$previousReleasesBuilder.AppendLine()
}
$previousReleaseTable = Get-ReleaseTable -Release $previousRelease -HeaderSize 3
[void]$previousReleasesBuilder.Append($previousReleaseTable)
}
}
$releasesContent = $releasesContent.Replace('${PreviousReleaseTables}', $previousReleasesBuilder.ToString())
Set-ContentAndStage -Path "$repositoryRoot\RELEASES.md" -Content $releasesContent -Stage:$StageChanges

9
scripts/hooks/pre-commit Normal file
Просмотреть файл

@ -0,0 +1,9 @@
#!/bin/sh
script="scripts/hooks/pre-commit.ps1"
if [ -f "$script" ]; then
powershell -NoProfile -ExecutionPolicy Bypass -File "$script"
exit $?
fi
exit 0

Просмотреть файл

@ -0,0 +1,49 @@
$VerbosePreference = 'Continue'
$ScriptsRoot = Resolve-Path -Path "$PSScriptRoot\.."
try
{
# Update CHECKSUMS file
& "$ScriptsRoot\UpdateChecksums.ps1" -StageChanges
}
catch
{
# Catch exception and write to host, but don't fail commit operation
Write-Host "Exception occured executing pre-commit script UpdateChecksums.ps1: $_"
}
try
{
# Update Dockerfiles
& "$ScriptsRoot\UpdateDockerfiles.ps1" -StageChanges
}
catch
{
# Catch exception and write to host, but don't fail commit operation
Write-Host "Exception occured executing pre-commit script UpdateDockerfiles.ps1: $_"
}
try
{
# Update README.md file
& "$ScriptsRoot\UpdateReadmeMarkdown.ps1" -StageChanges
}
catch
{
# Catch exception and write to host, but don't fail commit operation
Write-Host "Exception occured executing pre-commit script UpdateReadmeMarkdown.ps1: $_"
}
try
{
# Update RELEASES.md file
& "$ScriptsRoot\UpdateReleasesMarkdown.ps1" -StageChanges
}
catch
{
# Catch exception and write to host, but don't fail commit operation
Write-Host "Exception occured executing pre-commit script UpdateReleasesMarkdown.ps1: $_"
}
exit 0

Просмотреть файл

@ -0,0 +1,61 @@
[//]: # (WARNING! This is a file that is automatically generated from the /templates/README.md.template file.)
[//]: # (DO NOT edit the README.md file directly, otherwise its contents will be automatically overwritten from the template.)
[//]: # (Any intended change to the README.md file must be made in the /templates/README.md.template file.)
# Visual Studio Snapshot Debugger Docker Images
This repository contains Dockerfiles that demonstrate how to set up the Visual Studio Snapshot Debugger on Docker images.
## What is the Visual Studio Snapshot Debugger?
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
applications without interupting them. Please see https://aka.ms/snappoint for more infomration regarding the Visual Studio Snapshot Debugger.
## Dockerfiles
The Dockerfiles are organized according to the ASP.NET Core major and minor version, the OS platform, and the platform architecture.
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
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.
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".
## Latest Release
${LatestReleaseTable}
### Additional Information
- See [releases](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/RELEASES.md) for information about any current or previous release.
- See [checksums](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/CHECKSUMS) for checksum information for individual files in each release.
## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
## Developing
1. Clone this repository to your local machine.
2. Run init.cmd or init.ps1, found in the root of the repository.
This initialization script installs local Git hooks to automatically run update scripts when commits are made,
for example, the CHECKSUMS, README.md, and RELEASES.md files are updated automatically when a change is made to
the releases.json file.
## Issues
If you have any problems with or questions about this repository, please contact us through a
[GitHub issue](https://github.com/microsoft/vssnapshotdebugger-docker/issues).
## Licenses
- [Repository License](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/LICENSE)

Просмотреть файл

@ -0,0 +1,15 @@
[//]: # (WARNING! This is a file that is automatically generated from the /templates/RELEASES.md.template file.)
[//]: # (DO NOT edit the RELEASES.md file directly, otherwise its contents will be automatically overwritten from the template.)
[//]: # (Any intended change to the RELEASES.md file must be made in the /templates/RELEASES.md.template file.)
# Releases
See [checksums](https://github.com/microsoft/vssnapshotdebugger-docker/blob/master/CHECKSUMS) for checksum information for individual files in each release.
## Latest Release
${LatestReleaseTable}
## Previous Releases
${PreviousReleaseTables}