Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azuredevops/pipelineTemplates/jobs.publishModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
Write-Verbose "No Multi-Repo Checkout" -Verbose
$modulePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}'
}
Write-Host "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath"
Write-Output "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath"

# [Universal Artifact-feed publish] task(s)
#------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ jobs:
$moduleRepoRoot = '$(System.DefaultWorkingDirectory)'
$parametersRepoRoot = '$(System.DefaultWorkingDirectory)'
}
Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Host "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot"
Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Output "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot"

# [Agent] Replace tokens
#-----------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ jobs:
$moduleRepoRoot = '$(System.DefaultWorkingDirectory)'
$parametersRepoRoot = '$(System.DefaultWorkingDirectory)'
}
Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot"
Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot"

# [Agent] Prepare environment
#----------------------------
Expand Down Expand Up @@ -213,8 +213,8 @@ jobs:
$moduleRepoRoot = '$(System.DefaultWorkingDirectory)'
$parametersRepoRoot = '$(System.DefaultWorkingDirectory)'
}
Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot"
Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot"
Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot"

# [Agent] Prepare environment
#----------------------------
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/templates/getWorkflowInput/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ runs:
- name: Get workflow input parameters
id: get-input-param-action
run: |
# Grouping task logs
Write-Output "::group::Get workflow input parameters"

Write-Verbose "The workflow trigger is: ${{ github.event_name }}" -Verbose

# When running from workflow_dispatch event get input values
Expand All @@ -42,4 +45,6 @@ runs:

# Output values to be accessed by next jobs
Write-Output "::set-output name=removeDeployment::$removeDeployment"

Write-Output "::endgroup::"
shell: pwsh
15 changes: 15 additions & 0 deletions .github/actions/templates/publishModule/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ runs:
- name: 'Setup agent'
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Setup agent"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1')

Expand All @@ -51,6 +54,8 @@ runs:
# Set agent up
Set-EnvironmentOnAgent -PSModules $Modules

Write-Output "::endgroup::"

- name: Azure Login
uses: Azure/login@v1
with:
Expand All @@ -61,6 +66,9 @@ runs:
shell: pwsh
if: ${{ inputs.templateSpecsDoPublish == 'true' }}
run: |
# Grouping task logs
Write-Output "::group::Publish module to template specs"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1')
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1')
Expand Down Expand Up @@ -91,10 +99,15 @@ runs:
Publish-ModuleToTemplateSpec @functionInput -Verbose
}

Write-Output "::endgroup::"

- name: 'Publish module to private bicep registry'
shell: pwsh
if: ${{ inputs.bicepRegistryDoPublish == 'true' }}
run: |
# Grouping task logs
Write-Output "::group::Publish module to private bicep registry"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1')
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1')
Expand Down Expand Up @@ -124,3 +137,5 @@ runs:

Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose
}

Write-Output "::endgroup::"
26 changes: 26 additions & 0 deletions .github/actions/templates/validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ runs:
- name: 'Setup agent'
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Setup agent"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1')

Expand All @@ -64,6 +67,9 @@ runs:

# Set agent up
Set-EnvironmentOnAgent -PSModules $Modules

Write-Output "::endgroup::"

- name: Azure Login
uses: Azure/login@v1
with:
Expand All @@ -75,6 +81,9 @@ runs:
- name: 'Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] '
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Replace Parameter File Tokens [${{ inputs.parameterFilePath }}]"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1')

Expand Down Expand Up @@ -105,11 +114,16 @@ runs:
# Invoke Token Replacement Functionality
$null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose

Write-Output "::endgroup::"

# [Deployment validation] task(s)
# -------------------------------
- name: 'Validate [${{ inputs.templateFilePath }}]'
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Validate [${{ inputs.templateFilePath }}]"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1')

Expand All @@ -130,12 +144,17 @@ runs:

Test-TemplateWithParameterFile @functionInput -Verbose

Write-Output "::endgroup::"

# [Deployment execution] task(s)
# ------------------------------
- name: 'Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]'
shell: pwsh
id: deploy_step
run: |
# Grouping task logs
Write-Output "::group::Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceDeployment' 'New-ModuleDeployment.ps1')

Expand Down Expand Up @@ -175,12 +194,17 @@ runs:
throw $res.exception
}

Write-Output "::endgroup::"

# [Deployment removal] task(s)
# ----------------------------
- name: 'Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]'
shell: pwsh
if: ${{ always() && inputs.removeDeployment == 'true' && steps.deploy_step.outputs.deploymentName != '' }}
run: |
# Grouping task logs
Write-Output "::group::Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]"

# Load used function
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1')

Expand All @@ -198,3 +222,5 @@ runs:

Initialize-DeploymentRemoval @functionInput
}

Write-Output "::endgroup::"
15 changes: 15 additions & 0 deletions .github/actions/templates/validateModulePester/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ runs:
- name: 'Setup agent'
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Setup agent"

# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1')

Expand All @@ -26,6 +29,8 @@ runs:
# Set agent up
Set-EnvironmentOnAgent -PSModules $Modules

Write-Output "::endgroup::"

- name: Azure Login
uses: Azure/login@v1
with:
Expand All @@ -38,6 +43,9 @@ runs:
id: pester_run_step
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Run global tests via Pester"

$moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}")
$moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object {
(Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0
Expand Down Expand Up @@ -70,6 +78,8 @@ runs:
}
}

Write-Output "::endgroup::"

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always() && !contains('cancelled,skipped', steps.pester_run_step.outcome)
Expand All @@ -83,6 +93,9 @@ runs:
if: always()
shell: pwsh
run: |
# Grouping task logs
Write-Output "::group::Run API tests via Pester"

$moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}")
$moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object {
(Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0
Expand Down Expand Up @@ -115,6 +128,8 @@ runs:
}
}

Write-Output "::endgroup::"

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always() && !contains('cancelled,skipped', steps.pester_api_run_step.outcome)
Expand Down