Skip to content

Commit 93c2868

Browse files
author
Kristopher Turner
committed
refactor: reorganize repo — eliminate src/, promote tools to first-class dirs
- Eliminate src/ directory entirely - common/ — shared PowerShell modules (6), helpers, ansible common role, keyvault bicep - tools/vmfleet/ — full implementation with scripts, monitoring, infrastructure, reports, config, tests, logs - tools/fio|hammerdb|iperf|stress-ng/ — each with playbooks, ansible roles, config, stubs - tests/ — common/ for module tests; PSScriptAnalyzer stays at root - config/ — variables.example.yml + variables/variables.yml + variables/variables.schema.json - Removed config/clusters/, config/credentials/ (belong in demo-repository) - Updated all internal path references in scripts and tests - Updated all CI workflows (GitHub Actions, Azure DevOps, GitLab CI)
1 parent 2fbcbb6 commit 93c2868

111 files changed

Lines changed: 128 additions & 302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azuredevops/azure-pipelines-vmfleet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ stages:
3939
displayName: 'Initialize Environment'
4040
inputs:
4141
targetType: filePath
42-
filePath: src/core/powershell/helpers/Initialize-Environment.ps1
42+
filePath: common/helpers/Initialize-Environment.ps1
4343
arguments: >
4444
-ProjectRoot $(Build.SourcesDirectory)
4545
-ClusterConfigPath $(Build.SourcesDirectory)/config/clusters/${{ parameters.clusterConfig }}
@@ -57,7 +57,7 @@ stages:
5757
5858
$params = @{
5959
ClusterConfigPath = "$(Build.SourcesDirectory)/config/clusters/${{ parameters.clusterConfig }}"
60-
ProfilePath = "$(Build.SourcesDirectory)/config/profiles/vmfleet/${{ parameters.profile }}"
60+
ProfilePath = "$(Build.SourcesDirectory)/tools/vmfleet/config/profiles/${{ parameters.profile }}"
6161
ProjectRoot = "$(Build.SourcesDirectory)"
6262
Credential = $credential
6363
ReportFormats = @('PDF', 'XLSX')
@@ -67,7 +67,7 @@ stages:
6767
$params['SkipCleanup'] = $true
6868
}
6969
70-
& "$(Build.SourcesDirectory)/src/solutions/vmfleet/Invoke-VMFleetPipeline.ps1" @params
70+
& "$(Build.SourcesDirectory)/tools/vmfleet/Invoke-VMFleetPipeline.ps1" @params
7171
7272
- task: PublishBuildArtifacts@1
7373
displayName: 'Publish Reports'

.azuredevops/azure-pipelines.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ trigger:
1111
- main
1212
paths:
1313
include:
14-
- src/**
14+
- common/**
15+
- tools/**
1516
- tests/**
1617
- docs/**
1718
- config/**
@@ -52,9 +53,9 @@ stages:
5253
script: |
5354
Install-Module powershell-yaml -Force -Scope CurrentUser
5455
Import-Module powershell-yaml
55-
# Validate master config loads without errors
56-
$config = Get-Content config/variables/master-environment.yml -Raw | ConvertFrom-Yaml
57-
Write-Host "Master config loaded: $($config.variables.Count) variables"
56+
# Validate variables config loads without errors
57+
$config = Get-Content config/variables/variables.yml -Raw | ConvertFrom-Yaml
58+
Write-Host "Variables config loaded: $($config.variables.Count) variables"
5859
5960
- stage: Test
6061
displayName: 'Unit Tests'
@@ -79,7 +80,7 @@ stages:
7980
pwsh: true
8081
script: |
8182
$config = New-PesterConfiguration
82-
$config.Run.Path = 'tests'
83+
$config.Run.Path = @('tests', 'tools')
8384
$config.Run.Exit = $true
8485
$config.TestResult.Enabled = $true
8586
$config.TestResult.OutputPath = '$(Build.ArtifactStagingDirectory)/test-results.xml'

.github/workflows/lint.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ on:
1010
push:
1111
branches: [main]
1212
paths:
13-
- 'src/**/*.ps1'
14-
- 'src/**/*.psm1'
13+
- 'common/**/*.ps1'
14+
- 'common/**/*.psm1'
15+
- 'tools/**/*.ps1'
1516
- 'tests/**/*.ps1'
1617
- '.github/workflows/lint.yml'
1718
pull_request:
1819
branches: [main]
1920
paths:
20-
- 'src/**/*.ps1'
21-
- 'src/**/*.psm1'
21+
- 'common/**/*.ps1'
22+
- 'common/**/*.psm1'
23+
- 'tools/**/*.ps1'
2224
- 'tests/**/*.ps1'
2325
workflow_dispatch:
2426

.github/workflows/run-tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ on:
1010
push:
1111
branches: [main]
1212
paths:
13-
- 'src/**'
13+
- 'common/**'
14+
- 'tools/**'
1415
- 'tests/**'
1516
- '.github/workflows/run-tests.yml'
1617
pull_request:
1718
branches: [main]
1819
paths:
19-
- 'src/**'
20+
- 'common/**'
21+
- 'tools/**'
2022
- 'tests/**'
2123
workflow_dispatch:
2224

@@ -42,14 +44,14 @@ jobs:
4244
shell: pwsh
4345
run: |
4446
$config = New-PesterConfiguration
45-
$config.Run.Path = 'tests'
47+
$config.Run.Path = @('tests', 'tools')
4648
$config.Run.Exit = $true
4749
$config.Output.Verbosity = 'Detailed'
4850
$config.TestResult.Enabled = $true
4951
$config.TestResult.OutputPath = 'test-results.xml'
5052
$config.TestResult.OutputFormat = 'NUnitXml'
5153
$config.CodeCoverage.Enabled = $true
52-
$config.CodeCoverage.Path = @('src/core/powershell/modules')
54+
$config.CodeCoverage.Path = @('common/modules')
5355
$config.CodeCoverage.OutputPath = 'coverage.xml'
5456
$config.CodeCoverage.OutputFormat = 'JaCoCo'
5557

.github/workflows/run-vmfleet.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
required: true
1616
default: 'example-cluster.yml'
1717
profile:
18-
description: 'Workload profile (relative to config/profiles/vmfleet/)'
18+
description: 'Workload profile (relative to tools/vmfleet/config/profiles/)'
1919
required: false
2020
default: 'general.yml'
2121
report_formats:
@@ -67,7 +67,7 @@ jobs:
6767
- name: Initialize environment
6868
shell: pwsh
6969
run: |
70-
& "$env:PROJECT_ROOT\src\core\powershell\helpers\Initialize-Environment.ps1" `
70+
& "$env:PROJECT_ROOT\common\helpers\Initialize-Environment.ps1" `
7171
-ProjectRoot $env:PROJECT_ROOT `
7272
-ClusterConfigPath "$env:PROJECT_ROOT\config\clusters\${{ inputs.cluster_config }}" `
7373
-Solution VMFleet
@@ -92,7 +92,7 @@ jobs:
9292
9393
$profileInput = '${{ inputs.profile }}'
9494
if ($profileInput) {
95-
$params['ProfilePath'] = "$env:PROJECT_ROOT\config\profiles\vmfleet\$profileInput"
95+
$params['ProfilePath'] = "$env:PROJECT_ROOT\tools\vmfleet\config\profiles\$profileInput"
9696
}
9797
9898
if ('${{ inputs.skip_cleanup }}' -eq 'true') {
@@ -103,7 +103,7 @@ jobs:
103103
$params['IncludeAzureMonitor'] = $true
104104
}
105105
106-
& "$env:PROJECT_ROOT\src\solutions\vmfleet\Invoke-VMFleetPipeline.ps1" @params
106+
& "$env:PROJECT_ROOT\tools\vmfleet\Invoke-VMFleetPipeline.ps1" @params
107107
108108
- name: Upload test reports
109109
if: always()

.github/workflows/validate-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with open('config/variables.example.yml') as f:
4848
data = yaml.safe_load(f)
4949
50-
with open('config/schema/variables.schema.json') as f:
50+
with open('config/variables/variables.schema.json') as f:
5151
schema = json.load(f)
5252
5353
try:

.github/workflows/validate-repo-structure.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ jobs:
5555
echo "::error::Missing config/variables.example.yml"
5656
missing=$((missing + 1))
5757
fi
58-
if [ ! -f "config/schema/variables.schema.json" ]; then
59-
echo "::error::Missing config/schema/variables.schema.json"
58+
if [ ! -f "config/variables/variables.schema.json" ]; then
59+
echo "::error::Missing config/variables/variables.schema.json"
6060
missing=$((missing + 1))
6161
fi
6262
if [ $missing -gt 0 ]; then

.gitlab-ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ lint-powershell:
1818
- pwsh -File tests/PSScriptAnalyzer.ps1 -ProjectRoot $CI_PROJECT_DIR
1919
rules:
2020
- changes:
21-
- "src/**/*.ps1"
22-
- "src/**/*.psm1"
21+
- "common/**/*.ps1"
22+
- "common/**/*.psm1"
23+
- "tools/**/*.ps1"
2324
- "tests/**/*.ps1"
2425

2526
validate-config:
@@ -52,7 +53,7 @@ pester-tests:
5253
- |
5354
pwsh -Command "
5455
\$config = New-PesterConfiguration
55-
\$config.Run.Path = 'tests'
56+
\$config.Run.Path = @('tests', 'tools')
5657
\$config.Run.Exit = \$true
5758
\$config.TestResult.Enabled = \$true
5859
\$config.TestResult.OutputPath = 'test-results.xml'
@@ -64,7 +65,8 @@ pester-tests:
6465
junit: test-results.xml
6566
rules:
6667
- changes:
67-
- "src/**"
68+
- "common/**"
69+
- "tools/**"
6870
- "tests/**"
6971

7072
# ---- Docs Stage ----

0 commit comments

Comments
 (0)