Skip to content

Commit 986f792

Browse files
Rename repo to azurelocal-loadtools and restructure project
1 parent 2492086 commit 986f792

121 files changed

Lines changed: 9853 additions & 2 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.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# =============================================================================
2+
# Azure DevOps Pipeline - VMFleet Execution
3+
# =============================================================================
4+
# Runs the VMFleet load test pipeline on a self-hosted agent.
5+
# Requires: Self-hosted agent with WinRM access to Azure Local cluster.
6+
# =============================================================================
7+
8+
trigger: none # Manual trigger only
9+
10+
parameters:
11+
- name: clusterConfig
12+
displayName: 'Cluster config file'
13+
type: string
14+
default: 'example-cluster.yml'
15+
- name: profile
16+
displayName: 'Workload profile'
17+
type: string
18+
default: 'general.yml'
19+
- name: skipCleanup
20+
displayName: 'Skip cleanup after test'
21+
type: boolean
22+
default: false
23+
24+
pool:
25+
name: 'AzureLocal-SelfHosted' # Update with your agent pool name
26+
27+
variables:
28+
- group: azurelocal-loadtest-secrets # Variable group with credentials
29+
30+
stages:
31+
- stage: LoadTest
32+
displayName: 'VMFleet Load Test'
33+
jobs:
34+
- job: VMFleet
35+
displayName: 'Execute VMFleet Pipeline'
36+
timeoutInMinutes: 120
37+
steps:
38+
- task: PowerShell@2
39+
displayName: 'Initialize Environment'
40+
inputs:
41+
targetType: filePath
42+
filePath: src/core/powershell/helpers/Initialize-Environment.ps1
43+
arguments: >
44+
-ProjectRoot $(Build.SourcesDirectory)
45+
-ClusterConfigPath $(Build.SourcesDirectory)/config/clusters/${{ parameters.clusterConfig }}
46+
-Solution VMFleet
47+
pwsh: true
48+
49+
- task: PowerShell@2
50+
displayName: 'Run VMFleet Pipeline'
51+
inputs:
52+
targetType: inline
53+
pwsh: true
54+
script: |
55+
$secPassword = ConvertTo-SecureString '$(CLUSTER_ADMIN_PASSWORD)' -AsPlainText -Force
56+
$credential = New-Object PSCredential('$(CLUSTER_ADMIN_USERNAME)', $secPassword)
57+
58+
$params = @{
59+
ClusterConfigPath = "$(Build.SourcesDirectory)/config/clusters/${{ parameters.clusterConfig }}"
60+
ProfilePath = "$(Build.SourcesDirectory)/config/profiles/vmfleet/${{ parameters.profile }}"
61+
ProjectRoot = "$(Build.SourcesDirectory)"
62+
Credential = $credential
63+
ReportFormats = @('PDF', 'XLSX')
64+
}
65+
66+
if ('${{ parameters.skipCleanup }}' -eq 'True') {
67+
$params['SkipCleanup'] = $true
68+
}
69+
70+
& "$(Build.SourcesDirectory)/src/solutions/vmfleet/Invoke-VMFleetPipeline.ps1" @params
71+
72+
- task: PublishBuildArtifacts@1
73+
displayName: 'Publish Reports'
74+
condition: always()
75+
inputs:
76+
PathtoPublish: reports
77+
ArtifactName: vmfleet-reports
78+
79+
- task: PublishBuildArtifacts@1
80+
displayName: 'Publish Logs'
81+
condition: always()
82+
inputs:
83+
PathtoPublish: logs
84+
ArtifactName: vmfleet-logs

.azuredevops/azure-pipelines.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# =============================================================================
2+
# Azure DevOps Pipeline - Build & Test
3+
# =============================================================================
4+
# Placeholder pipeline for Azure DevOps.
5+
# Import this as a pipeline in Azure DevOps to run tests and build docs.
6+
# =============================================================================
7+
8+
trigger:
9+
branches:
10+
include:
11+
- main
12+
paths:
13+
include:
14+
- src/**
15+
- tests/**
16+
- docs/**
17+
- config/**
18+
19+
pool:
20+
vmImage: 'windows-latest'
21+
22+
stages:
23+
- stage: Validate
24+
displayName: 'Validate & Lint'
25+
jobs:
26+
- job: Lint
27+
displayName: 'PSScriptAnalyzer'
28+
steps:
29+
- task: PowerShell@2
30+
displayName: 'Install PSScriptAnalyzer'
31+
inputs:
32+
targetType: inline
33+
pwsh: true
34+
script: |
35+
Install-Module PSScriptAnalyzer -Force -Scope CurrentUser
36+
37+
- task: PowerShell@2
38+
displayName: 'Run PSScriptAnalyzer'
39+
inputs:
40+
targetType: filePath
41+
filePath: tests/PSScriptAnalyzer.ps1
42+
pwsh: true
43+
44+
- job: ConfigValidation
45+
displayName: 'Validate Configs'
46+
steps:
47+
- task: PowerShell@2
48+
displayName: 'Validate YAML/JSON configs'
49+
inputs:
50+
targetType: inline
51+
pwsh: true
52+
script: |
53+
Install-Module powershell-yaml -Force -Scope CurrentUser
54+
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"
58+
59+
- stage: Test
60+
displayName: 'Unit Tests'
61+
dependsOn: Validate
62+
jobs:
63+
- job: Pester
64+
displayName: 'Run Pester Tests'
65+
steps:
66+
- task: PowerShell@2
67+
displayName: 'Install dependencies'
68+
inputs:
69+
targetType: inline
70+
pwsh: true
71+
script: |
72+
Install-Module Pester -Force -Scope CurrentUser -MinimumVersion 5.0
73+
Install-Module powershell-yaml -Force -Scope CurrentUser
74+
75+
- task: PowerShell@2
76+
displayName: 'Run Pester'
77+
inputs:
78+
targetType: inline
79+
pwsh: true
80+
script: |
81+
$config = New-PesterConfiguration
82+
$config.Run.Path = 'tests'
83+
$config.Run.Exit = $true
84+
$config.TestResult.Enabled = $true
85+
$config.TestResult.OutputPath = '$(Build.ArtifactStagingDirectory)/test-results.xml'
86+
$config.TestResult.OutputFormat = 'NUnitXml'
87+
Invoke-Pester -Configuration $config
88+
89+
- task: PublishTestResults@2
90+
displayName: 'Publish test results'
91+
condition: always()
92+
inputs:
93+
testResultsFormat: NUnit
94+
testResultsFiles: '$(Build.ArtifactStagingDirectory)/test-results.xml'
95+
96+
# =============================================================================
97+
# VMFleet execution pipeline (separate, manually triggered)
98+
# =============================================================================
99+
# To create a separate pipeline for VMFleet execution:
100+
# 1. Create azure-pipelines-vmfleet.yml
101+
# 2. Use a self-hosted agent pool with cluster access
102+
# 3. Add pipeline variables for credentials
103+
# 4. Use the Invoke-VMFleetPipeline.ps1 orchestrator

.editorconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# =============================================================================
2+
# Azure Local Load Tools - EditorConfig
3+
# https://editorconfig.org
4+
# =============================================================================
5+
6+
root = true
7+
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.{ps1,psm1,psd1}]
15+
indent_style = space
16+
indent_size = 4
17+
18+
[*.{yml,yaml}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[*.json]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.{adoc,asciidoc}]
27+
indent_style = space
28+
indent_size = 2
29+
trim_trailing_whitespace = false
30+
31+
[*.{bicep,tf}]
32+
indent_style = space
33+
indent_size = 2
34+
35+
[*.{sh,bash}]
36+
indent_style = space
37+
indent_size = 2
38+
39+
[*.xml]
40+
indent_style = space
41+
indent_size = 2
42+
43+
[Makefile]
44+
indent_style = tab

.github/workflows/build-docs.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# =============================================================================
2+
# build-docs.yml - Build AsciiDoc documentation
3+
# =============================================================================
4+
# Builds PDF documentation using asciidoctor-pdf and exports draw.io diagrams.
5+
# =============================================================================
6+
7+
name: Build Documentation
8+
9+
on:
10+
push:
11+
branches: [main]
12+
paths:
13+
- 'docs/**'
14+
- '.github/workflows/build-docs.yml'
15+
pull_request:
16+
branches: [main]
17+
paths:
18+
- 'docs/**'
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
build-docs:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Ruby for Asciidoctor
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: '3.2'
36+
bundler-cache: false
37+
38+
- name: Install Asciidoctor toolchain
39+
run: |
40+
gem install asciidoctor asciidoctor-pdf rouge
41+
42+
- name: Export draw.io diagrams
43+
uses: rlespinasse/drawio-export-action@v2
44+
with:
45+
path: docs/diagrams
46+
format: png
47+
output: docs/images
48+
49+
- name: Build PDF documentation
50+
run: |
51+
asciidoctor-pdf \
52+
-a pdf-theme=docs/themes/azurelocal-theme.yml \
53+
-a pdf-fontsdir=docs/themes/fonts \
54+
-a imagesdir=docs/images \
55+
-o docs/output/azurelocal-loadtools.pdf \
56+
docs/main.adoc
57+
58+
- name: Build HTML documentation
59+
run: |
60+
asciidoctor \
61+
-a imagesdir=images \
62+
-o docs/output/index.html \
63+
docs/main.adoc
64+
65+
- name: Upload documentation artifacts
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: documentation
69+
path: docs/output/
70+
retention-days: 30

.github/workflows/lint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# =============================================================================
2+
# lint.yml - PSScriptAnalyzer linting
3+
# =============================================================================
4+
# Lints all PowerShell scripts with PSScriptAnalyzer.
5+
# =============================================================================
6+
7+
name: Lint PowerShell
8+
9+
on:
10+
push:
11+
branches: [main]
12+
paths:
13+
- 'src/**/*.ps1'
14+
- 'src/**/*.psm1'
15+
- 'tests/**/*.ps1'
16+
- '.github/workflows/lint.yml'
17+
pull_request:
18+
branches: [main]
19+
paths:
20+
- 'src/**/*.ps1'
21+
- 'src/**/*.psm1'
22+
- 'tests/**/*.ps1'
23+
workflow_dispatch:
24+
25+
permissions:
26+
contents: read
27+
28+
jobs:
29+
lint:
30+
runs-on: windows-latest
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Install PSScriptAnalyzer
37+
shell: pwsh
38+
run: |
39+
Install-Module PSScriptAnalyzer -Force -Scope CurrentUser
40+
41+
- name: Run PSScriptAnalyzer
42+
shell: pwsh
43+
run: |
44+
& "${{ github.workspace }}\tests\PSScriptAnalyzer.ps1" -ProjectRoot "${{ github.workspace }}"

0 commit comments

Comments
 (0)