Skip to content

Commit

Permalink
Merge pull request #75 from techthoughts2/Enhancements
Browse files Browse the repository at this point in the history
Enhancements
  • Loading branch information
techthoughts2 committed Apr 13, 2024
2 parents c825f2a + 76ac806 commit 26c67c6
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 12 deletions.
11 changes: 11 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0]

- Catesta template module changes
- Catesta now supports namespaced modules (ex. `MyModule.Utils` )
- CI/CD Changes:
- Azure:
- Updated `PublishCodeCoverageResults@1` to `PublishCodeCoverageResults@2`
- Catesta primary module changes
- Updated build file to use new regex pattern for deriving module name
- Added tests for namespaced module creation

## [2.2.0]

- Catesta template module changes
Expand Down
2 changes: 1 addition & 1 deletion docs/Catesta.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module Name: Catesta
Module Guid: 6796b193-9013-468a-b022-837749af2d06
Download Help Link: NA
Help Version: 2.2.0
Help Version: 2.4.0
Locale: en-US
---

Expand Down
4 changes: 2 additions & 2 deletions src/Catesta.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#>

#Include: Settings
$ModuleName = (Split-Path -Path $BuildFile -Leaf).Split('.')[0]
$ModuleName = [regex]::Match((Get-Item $BuildFile).Name, '^(.*)\.build\.ps1$').Groups[1].Value
. "./$ModuleName.Settings.ps1"

function Test-ManifestBool ($Path) {
Expand Down Expand Up @@ -67,7 +67,7 @@ Add-BuildTask BuildNoIntegration -Jobs $str2

# Pre-build variables to be used by other portions of the script
Enter-Build {
$script:ModuleName = (Split-Path -Path $BuildFile -Leaf).Split('.')[0]
$script:ModuleName = [regex]::Match((Get-Item $BuildFile).Name, '^(.*)\.build\.ps1$').Groups[1].Value

# Identify other required paths
$script:ModuleSourcePath = Join-Path -Path $BuildRoot -ChildPath $script:ModuleName
Expand Down
2 changes: 1 addition & 1 deletion src/Catesta/Catesta.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Catesta.psm1'

# Version number of this module.
ModuleVersion = '2.2.0'
ModuleVersion = '2.4.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
8 changes: 4 additions & 4 deletions src/Catesta/Resources/Azure/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'windows') {
testRunTitle: 'ps_winLatest'
failTaskOnFailedTests: true
displayName: "Publish Unit Test Results - Windows PowerShell"
- task: PublishCodeCoverageResults@1
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '**\Artifacts\ccReport\CodeCoverage.xml'
pathToSources: '$(System.DefaultWorkingDirectory)\src\Artifacts\ccReport'
Expand Down Expand Up @@ -65,7 +65,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'pwshcore') {
testRunTitle: 'pwsh_winLatest'
failTaskOnFailedTests: true
displayName: "Publish Unit Test Results - Windows pwsh"
- task: PublishCodeCoverageResults@1
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '**\Artifacts\ccReport\CodeCoverage.xml'
pathToSources: '$(System.DefaultWorkingDirectory)\src\Artifacts\ccReport'
Expand Down Expand Up @@ -101,7 +101,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'linux') {
testRunTitle: 'pwsh_ubuntuLatest'
failTaskOnFailedTests: true
displayName: "Publish Unit Test Results - Linux"
- task: PublishCodeCoverageResults@1
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '**/Artifacts/ccReport/CodeCoverage.xml'
pathToSources: '$(System.DefaultWorkingDirectory)/src/Artifacts/ccReport'
Expand Down Expand Up @@ -137,7 +137,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'macos') {
testRunTitle: 'pwsh_macOSLatest'
failTaskOnFailedTests: true
displayName: "Publish Unit Test Results - macOS"
- task: PublishCodeCoverageResults@1
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '**/Artifacts/ccReport/CodeCoverage.xml'
pathToSources: '$(System.DefaultWorkingDirectory)/src/Artifacts/ccReport'
Expand Down
2 changes: 1 addition & 1 deletion src/Catesta/Resources/Module/plasterManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<metadata>
<name>Catesta</name>
<id>258a61ba-566b-4c3a-8230-c2b6861a1a8d</id>
<version>2.2.0</version>
<version>2.4.0</version>
<title>Catesta</title>
<description>Scaffolds a new PowerShell module project</description>
<author>Jake Morrison</author>
Expand Down
4 changes: 2 additions & 2 deletions src/Catesta/Resources/Module/src/PSModule.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#>

#Include: Settings
$ModuleName = (Split-Path -Path $BuildFile -Leaf).Split('.')[0]
$ModuleName = [regex]::Match((Get-Item $BuildFile).Name, '^(.*)\.build\.ps1$').Groups[1].Value
. "./$ModuleName.Settings.ps1"

function Test-ManifestBool ($Path) {
Expand Down Expand Up @@ -79,7 +79,7 @@ Add-BuildTask BuildNoIntegration -Jobs $str2

# Pre-build variables to be used by other portions of the script
Enter-Build {
$script:ModuleName = (Split-Path -Path $BuildFile -Leaf).Split('.')[0]
$script:ModuleName = [regex]::Match((Get-Item $BuildFile).Name, '^(.*)\.build\.ps1$').Groups[1].Value

# Identify other required paths
$script:ModuleSourcePath = Join-Path -Path $BuildRoot -ChildPath $script:ModuleName
Expand Down
2 changes: 1 addition & 1 deletion src/Catesta/Resources/Vault/plasterManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<metadata>
<name>Catesta</name>
<id>d531e058-52b8-4dd2-8162-01c95d1eb8f7</id>
<version>2.2.0</version>
<version>2.4.0</version>
<title>Catesta</title>
<description>Scaffolds a new PowerShell SecretManagement extension vault module project</description>
<author>Jake Morrison</author>
Expand Down
40 changes: 40 additions & 0 deletions src/Tests/Integration/New-ModuleProject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,46 @@ Describe 'Module Integration Tests' {

} #it

It 'should generate a namespaced module only scaffold with base elements' {
$moduleParameters = @{
VAULT = 'text'
ModuleName = 'module.name'
Description = 'text'
Version = '0.0.1'
FN = 'user full name'
CICD = 'NONE'
RepoType = 'NONE'
CodingStyle = 'Stroustrup'
Help = 'Yes'
Pester = '5'
S3Bucket = 'PSGallery'
PassThru = $true
NoLogo = $true
}
$eval = New-ModuleProject -ModuleParameters $moduleParameters -DestinationPath $outPutPath
$eval | Should -Not -BeNullOrEmpty

$moduleOnlyFiles = Get-ChildItem -Path $outPutPathStar -Recurse -Force

# MODULE
$moduleOnlyFiles.Name.Contains('module.name.psd1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('module.name.psm1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('Imports.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('module.name.build.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('module.name.Settings.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('MarkdownRepair.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('PSScriptAnalyzerSettings.psd1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('Get-HelloWorld.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('Get-Day.ps1') | Should -BeExactly $true

# Tests
$moduleOnlyFiles.Name.Contains('SampleIntegrationTest.Tests.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('ExportedFunctions.Tests.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('module.name-Module.Tests.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('Get-HelloWorld.Tests.ps1') | Should -BeExactly $true
$moduleOnlyFiles.Name.Contains('Get-Day.Tests.ps1') | Should -BeExactly $true
} #it

} #context_module_only

Context 'AWS-CodeBuild' {
Expand Down

0 comments on commit 26c67c6

Please sign in to comment.