зеркало из
1
0
Форкнуть 0
This commit is contained in:
Bernie White 2024-08-14 16:54:57 +10:00 коммит произвёл GitHub
Родитель 2391c3b789
Коммит 39aa1e45e9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
15 изменённых файлов: 243 добавлений и 42 удалений

13
.config/dotnet-tools.json Normal file
Просмотреть файл

@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"gitversion.tool": {
"version": "5.12.0",
"commands": [
"dotnet-gitversion"
],
"rollForward": false
}
}
}

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

@ -1,12 +0,0 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Visual Studio Code image with .NET
# NOTE:
# See here for image contents: https://github.com/devcontainers/images/tree/main/src/dotnet
ARG VARIANT="7.0-bullseye-slim"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:${VARIANT}
RUN sudo apt update -y && sudo apt install python3-pip python3-wheel -y

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

@ -5,10 +5,18 @@
# This is run during container creation.
# Install Python 3 dependencies
sudo apt install python3-pip -y
sudo apt-get update
sudo apt-get install dotnet-sdk-8.0 -y
sudo apt-get install python3-pip -y
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install wheel
# Install Python packages
pip install -r requirements-docs.txt
# Restore .NET packages
dotnet restore
# Install PowerShell dependencies
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue;
if ($Null -eq (Get-PackageProvider -Name NuGet -ErrorAction Ignore)) {

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

@ -1,18 +1,20 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "PSRule for Azure Developer Codespace",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "pwsh",
"terminal.integrated.profiles.linux": {
"pwsh": {
"path": "/opt/microsoft/powershell/7/pwsh"
"path": "/usr/local/bin/pwsh"
}
}
},
"powershell.powerShellDefaultVersion": "PowerShell"
},
"extensions": [
"ms-dotnettools.vscode-dotnet-runtime",
"ms-dotnettools.csdevkit",
"ms-vscode.powershell",
"ms-azuretools.vscode-bicep",
@ -21,29 +23,25 @@
"github.vscode-github-actions",
"bewhite.psrule-vscode-preview",
"davidanson.vscode-markdownlint",
"streetsidesoftware.code-spell-checker",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker"
"ms-sarifvscode.sarif-viewer",
"github.vscode-github-actions"
]
}
},
"features": {
"ghcr.io/devcontainers/features/github-cli": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/powershell": {
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "latest"
}
},
"onCreateCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "7.0-bullseye-slim"
}
},
"remoteUser": "vscode",
"forwardPorts": [
8000
]
"onCreateCommand": "sudo chown -R vscode:vscode /opt/microsoft/powershell/7/pwsh && sudo chmod u+x /opt/microsoft/powershell/7/pwsh && wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb && sudo apt-get update && sudo apt-get install dotnet-sdk-8.0 -y && sudo apt-get install python3-pip -y",
"updateContentCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1"
}

2
.github/workflows/build.yaml поставляемый
Просмотреть файл

@ -16,7 +16,7 @@ on:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_VERSION: 7.x
DOTNET_VERSION: 8.x
jobs:
build:

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

@ -29,6 +29,8 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers
## Unreleased
What's changed since pre-release v1.39.0-B0029:
- New rules:
- Virtual Machine:
- Verify that virtual machines does not have public IPs attached by @BenjaminEngeset.
@ -36,6 +38,9 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers
- Virtual Machine Scale Sets:
- Verify that virtual machine scale set instances does not have public IPs attached by @BenjaminEngeset.
[#3014](https://github.com/Azure/PSRule.Rules.Azure/issues/3014)
- Engineering:
- Bump development tools to .NET 8.0 SDK by @BernieWhite.
[#3017](https://github.com/Azure/PSRule.Rules.Azure/issues/3017)
## v1.39.0-B0029 (pre-release)

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

@ -259,9 +259,9 @@ This build script will compile the module and documentation then output the resu
| Operating System | Tool | Overview | Installation Link |
| ---------------- | ---- | -------- | ----------------- |
| Windows | Windows PowerShell | Support for version 5.1 with .NET Framework 4.7.2 or greater. | [link](https://dotnet.microsoft.com/download/dotnet-framework/net48) |
| Windows, MacOS, Linux | PowerShell | Version 7.3 or greater is support. | [link](https://github.com/PowerShell/PowerShell#get-powershell) |
| Windows, MacOS, Linux | PowerShell | Version 7.4 or greater is support. | [link](https://github.com/PowerShell/PowerShell#get-powershell) |
| - | - | Multiple PowerShell modules are required (PlatyPS, Pester, PSScriptAnalyzer, PowerShellGet, PackageManagement, InvokeBuild, PSRule). | Installed when you run the `build.ps1` script |
| - | .NET | .NET SDK v7 is required. | [link](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) |
| - | .NET | .NET SDK v8 is required. | [link](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) |
| - | Bicep CLI | PSRule depends on the Bicep CLI to expand Bicep modules to ARM | [link](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/install) |
The following dependencies will be automatically installed if the required versions are not present:

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

@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.400",
"rollForward": "latestFeature"
}
}

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

@ -4,13 +4,18 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<!-- <Nullable>enable</Nullable> -->
<!-- <ImplicitUsings>enable</ImplicitUsings> -->
<NeutralLanguage>en-US</NeutralLanguage>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(CI)' == 'true' And '$(GITHUB_ACTIONS)' != 'true'">true</RestoreLockedMode>
</PropertyGroup>
<!-- Package metadata -->

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

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<ProjectGuid>{9bb90abe-25f9-4110-af9f-149b0618b2a0}</ProjectGuid>
<RepositoryUrl>https://github.com/Azure/PSRule.Rules.Azure</RepositoryUrl>
@ -19,9 +19,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.12" />
<PackageReference Include="System.Management.Automation" Version="7.3.12" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.4" />
<PackageReference Include="System.Management.Automation" Version="7.4.4" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">

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

@ -2,7 +2,7 @@
<Import Project="..\PSRule.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ProjectGuid>{218b2d45-a2bd-4966-9b9f-4064cd68ba8a}</ProjectGuid>
<EnableNuget>false</EnableNuget>
<IsPackable>false</IsPackable>

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

@ -0,0 +1,53 @@
{
"version": 1,
"dependencies": {
"net8.0": {
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "8.0.0",
"Microsoft.SourceLink.Common": "8.0.0"
}
},
"Newtonsoft.Json": {
"type": "Direct",
"requested": "[13.0.3, )",
"resolved": "13.0.3",
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
},
"System.CommandLine": {
"type": "Direct",
"requested": "[2.0.0-beta1.21308.1, )",
"resolved": "2.0.0-beta1.21308.1",
"contentHash": "X8qLygjyktfmcNMNFekMkumyaTblJmkH3BBbKiQlk4FvJfp613gkMKrA0CNqLUT9tEfLcm3XMzAbsiYFwM8zbQ==",
"dependencies": {
"Microsoft.CSharp": "4.4.1",
"system.memory": "4.5.4"
}
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.CSharp": {
"type": "Transitive",
"resolved": "4.4.1",
"contentHash": "A5hI3gk6WpcBI0QGZY6/d5CCaYUxJgi7iENn1uYEng+Olo8RfI5ReGVkjXjeu3VR3srLvVYREATXa2M0X7FYJA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
}
}
}
}

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

@ -0,0 +1,65 @@
{
"version": 1,
"dependencies": {
".NETStandard,Version=v2.0": {
"Microsoft.CodeAnalysis.NetAnalyzers": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "8.0.0",
"Microsoft.SourceLink.Common": "8.0.0"
}
},
"NETStandard.Library": {
"type": "Direct",
"requested": "[2.0.3, )",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"Newtonsoft.Json": {
"type": "Direct",
"requested": "[13.0.3, )",
"resolved": "13.0.3",
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
},
"PowerShellStandard.Library": {
"type": "Direct",
"requested": "[5.1.1, )",
"resolved": "5.1.1",
"contentHash": "e31xJjG+Kjbv6YF3Yq6D4Dl3or8v7LrNF41k3CXrWozW6hR1zcOe5KYuZJaGSiAgLnwP8wcW+I3+IWEzMPZKXQ=="
},
"YamlDotNet": {
"type": "Direct",
"requested": "[11.2.1, )",
"resolved": "11.2.1",
"contentHash": "tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
}
}
}
}

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

@ -0,0 +1,58 @@
{
"version": 1,
"dependencies": {
".NETStandard,Version=v2.0": {
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "8.0.0",
"Microsoft.SourceLink.Common": "8.0.0"
}
},
"NETStandard.Library": {
"type": "Direct",
"requested": "[2.0.3, )",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.3",
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
},
"YamlDotNet": {
"type": "Transitive",
"resolved": "11.2.1",
"contentHash": "tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw=="
},
"Microsoft.PSRule.Rules.Azure.Core": {
"type": "Project",
"dependencies": {
"Newtonsoft.Json": "[13.0.3, )",
"YamlDotNet": "[11.2.1, )"
}
}
}
}
}

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

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ProjectGuid>{28251f7f-fc8c-495b-af73-d134f642ffb9}</ProjectGuid>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
@ -11,8 +11,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.12" />
<PackageReference Include="System.Management.Automation" Version="7.3.12" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.4" />
<PackageReference Include="System.Management.Automation" Version="7.4.4" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>