Skip to content

Commit

Permalink
Bump PSRule versions #77 #78 #79 (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite authored Nov 23, 2021
1 parent 33d4077 commit 6146f09
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ stages:
- template: jobs/test.yaml
parameters:
name: windows_2019
displayName: 'PowerShell 7.1 - Windows 2019'
displayName: 'PowerShell 5.1 - Windows 2019'
imageName: 'windows-2019'
pwsh: 'false'

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

What's changed since v0.2.0:

- General improvements:
- Updated default baseline to use module configuration. [#79](https://github.com/microsoft/PSRule.Rules.CAF/issues/79)
- Engineering:
- Bump PSRule dependency to v1.9.0. [#77](https://github.com/microsoft/PSRule.Rules.CAF/issues/77)
- Bump PSRule.Rules.Azure dependency to v1.9.1. [#78](https://github.com/microsoft/PSRule.Rules.CAF/issues/78)

## v0.2.0

What's changed since v0.1.0:
Expand Down
15 changes: 6 additions & 9 deletions pipeline.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,16 @@ task VersionModule ModuleDependencies, {
$manifest = Test-ModuleManifest -Path $manifestPath;
$requiredModules = $manifest.RequiredModules | ForEach-Object -Process {
if ($_.Name -eq 'PSRule' -and $Configuration -eq 'Release') {
@{ ModuleName = 'PSRule'; ModuleVersion = '1.3.0' }
@{ ModuleName = 'PSRule'; ModuleVersion = '1.9.0' }
}
elseif ($_.Name -eq 'PSRule.Rules.Azure' -and $Configuration -eq 'Release') {
@{ ModuleName = 'PSRule.Rules.Azure'; ModuleVersion = '1.3.2' }
@{ ModuleName = 'PSRule.Rules.Azure'; ModuleVersion = '1.9.1' }
}
else {
@{ ModuleName = $_.Name; ModuleVersion = $_.Version }
}
};
Update-ModuleManifest -Path $manifestPath -RequiredModules $requiredModules;
$manifestContent = Get-Content -Path $manifestPath -Raw;
$manifestContent = $manifestContent -replace 'PSRule = ''System.Collections.Hashtable''', 'PSRule = @{ Baseline = ''CAF.Strict'' }';
$manifestContent | Set-Content -Path $manifestPath;
}

# Synopsis: Publish to PowerShell Gallery
Expand Down Expand Up @@ -161,11 +158,11 @@ task PSScriptAnalyzer NuGet, {

# Synopsis: Install PSRule
task PSRule NuGet, {
if ($Null -eq (Get-InstalledModule -Name PSRule -MinimumVersion 1.3.0 -ErrorAction Ignore)) {
Install-Module -Name PSRule -Repository PSGallery -MinimumVersion 1.3.0 -Scope CurrentUser -Force;
if ($Null -eq (Get-InstalledModule -Name PSRule -MinimumVersion 1.9.0 -ErrorAction Ignore)) {
Install-Module -Name PSRule -Repository PSGallery -MinimumVersion 1.9.0 -Scope CurrentUser -Force;
}
if ($Null -eq (Get-InstalledModule -Name PSRule.Rules.Azure -MinimumVersion 1.3.2 -ErrorAction Ignore)) {
Install-Module -Name PSRule.Rules.Azure -Repository PSGallery -MinimumVersion 1.3.2 -Scope CurrentUser -Force;
if ($Null -eq (Get-InstalledModule -Name PSRule.Rules.Azure -MinimumVersion 1.9.1 -ErrorAction Ignore)) {
Install-Module -Name PSRule.Rules.Azure -Repository PSGallery -MinimumVersion 1.9.1 -Scope CurrentUser -Force;
}
if ($Null -eq (Get-InstalledModule -Name PSRule.Rules.MSFT.OSS -MinimumVersion 0.1.0 -ErrorAction Ignore)) {
Install-Module -Name PSRule.Rules.MSFT.OSS -Repository PSGallery -MinimumVersion 0.1.0 -Scope CurrentUser -Force;
Expand Down
4 changes: 2 additions & 2 deletions ps-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ bugs:
url: https://github.com/Microsoft/PSRule.Rules.CAF/issues

modules:
PSRule: ^1.3.0
PSRule.Rules.Azure: ^1.3.2
PSRule: ^1.9.0
PSRule.Rules.Azure: ^1.9.1

tasks:
clear:
Expand Down
8 changes: 8 additions & 0 deletions ps-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# Please see the documentation for all configuration options:
# https://microsoft.github.io/PSRule/

requires:
PSRule: '@pre >=1.9.0'

input:
pathIgnore:
- '.vscode/'
Expand All @@ -22,3 +25,8 @@ include:
output:
culture:
- en-US

configuration:
# Authoring rules
# RULE_AUTHORING_ONLINE_HELP: 'https://azure.github.io/PSRule.Rules.CAF/en/rules/'
RULE_AUTHORING_PREFIX: 'CAF'
3 changes: 0 additions & 3 deletions src/PSRule.Rules.CAF/PSRule.Rules.CAF.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ PrivateData = @{
# ReleaseNotes of this module
ReleaseNotes = 'https://github.com/Microsoft/PSRule.Rules.CAF/blob/main/CHANGELOG.md'
} # End of PSData hashtable
PSRule = @{
Baseline = 'CAF.Strict'
}
} # End of PrivateData hashtable

# HelpInfo URI of this module
Expand Down
2 changes: 2 additions & 0 deletions src/PSRule.Rules.CAF/rules/Baseline.Rule.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

---
# Synopsis: The default baseline for Azure Cloud Adoption Framework
Expand Down
4 changes: 4 additions & 0 deletions src/PSRule.Rules.CAF/rules/Config.Rule.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

---
# Synopsis: Configuration for PSRule.Rules.CAF
Expand All @@ -17,3 +19,5 @@ spec:
resourceId: [ 'ResourceId' ]
subscriptionId: [ 'SubscriptionId' ]
resourceGroupName: [ 'ResourceGroupName' ]
rule:
baseline: 'CAF.Strict'

0 comments on commit 6146f09

Please sign in to comment.