Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a first version to allow for custom removal scripts & retry #431

Merged
merged 33 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
80d5e85
Moved removal script + updated required parameters + added relativ re…
AlexanderSehr Nov 6, 2021
6fb902e
Temp disabled net app tests
AlexanderSehr Nov 6, 2021
f3effa4
Update to latest
AlexanderSehr Nov 6, 2021
3616a40
Minor path fix
AlexanderSehr Nov 6, 2021
e2ea398
Update to latest
AlexanderSehr Nov 6, 2021
e43dfde
Update to latest
AlexanderSehr Nov 6, 2021
5ef3013
Update to latest
AlexanderSehr Nov 6, 2021
769b016
Update to latest
AlexanderSehr Nov 6, 2021
e417fac
Setup vwan
AlexanderSehr Nov 6, 2021
2e5c1c5
Re-enabled all jobs
AlexanderSehr Nov 6, 2021
604672c
Update to latest
AlexanderSehr Nov 6, 2021
a233491
Added retry logic to find tags
AlexanderSehr Nov 6, 2021
abd2fe1
Merged with latest main
AlexanderSehr Nov 6, 2021
7d16c09
Update to latest
AlexanderSehr Nov 6, 2021
6bdf403
Fixed output
AlexanderSehr Nov 6, 2021
5e99b78
Increased retry
AlexanderSehr Nov 6, 2021
718783c
Updated inputs, defaults & docs of the removal functions
AlexanderSehr Nov 7, 2021
cc1d922
Update to latest
AlexanderSehr Nov 7, 2021
854ba8b
Fixed typo
AlexanderSehr Nov 8, 2021
6642d31
Moved removal retry logic into remove-script
AlexanderSehr Nov 8, 2021
723d077
Update to resource group removal
AlexanderSehr Nov 8, 2021
6d5c939
minor fix
AlexanderSehr Nov 8, 2021
197a0c6
Reshuffled strucure
AlexanderSehr Nov 8, 2021
56582bf
Update to latest
AlexanderSehr Nov 8, 2021
5216e69
Update to latest
AlexanderSehr Nov 8, 2021
c05ebfb
Adjusted arrays
AlexanderSehr Nov 9, 2021
d5c2598
Update to latest
AlexanderSehr Nov 9, 2021
262f1c3
Fixed ref
AlexanderSehr Nov 9, 2021
a699e20
Updated docs
AlexanderSehr Nov 9, 2021
348c96a
Cleanup
AlexanderSehr Nov 9, 2021
0ada93e
Merged latest main
AlexanderSehr Nov 9, 2021
96e99b7
Minor update for readability
AlexanderSehr Nov 10, 2021
d9abe94
Merge branch 'main' of https://github.com/Azure/ResourceModules into …
Nov 10, 2021
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: 2 additions & 0 deletions .github/actions/sharedScripts/Set-EnvironmentOnAgent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function Set-EnvironmentOnAgent {
[Hashtable[]] $Modules = @(
@{ Name = 'Az.Accounts' },
@{ Name = 'Az.Resources' },
@{ Name = 'Az.NetAppFiles' },
@{ Name = 'Az.Network' },
@{ Name = 'Az.ContainerRegistry' }
)
)
Expand Down
19 changes: 12 additions & 7 deletions .github/actions/templates/removeModule/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ inputs:
required: true
resourceGroupName:
description: 'The resource group the module is deployed into'
required: true
required: false
relativePathOfRemovalScript:
description: 'The relative path from root to the script that removes the service'
required: false
default: 'utilities/resourceRemoval/Remove-DeployedModule.ps1'

runs:
using: 'composite'
Expand All @@ -33,15 +37,16 @@ runs:
shell: pwsh
run: |
# Load used functions
. "$env:GITHUB_ACTION_PATH/scripts/Remove-DeployedModule.ps1"
$functionPath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.relativePathOfRemovalScript }}'
. $functionPath

$functionInput = @{
moduleName = '${{ inputs.moduleName }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
templateFilePath = '${{ inputs.templateFilePath }}'
moduleName = '${{ inputs.moduleName }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
verbose = $true
}

Write-Verbose "Invoke task with" -Verbose
Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose

Remove-DeployedModule @functionInput -Verbose
Invoke-Expression ('{0} @functionInput' -f (Split-Path $functionPath -LeafBase))

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/ms.analysisservices.servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.apimanagement.service.apis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.apimanagement.service.backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.apimanagement.service.caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.apimanagement.service.products.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.apimanagement.service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.authorization.policyassignments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.authorization.policydefinitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.authorization.policyexemptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.authorization.policysetdefinitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.authorization.roleassignments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.authorization.roledefinitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.automanage.accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.automation.automationaccounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.batch.batchaccounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.cognitiveservices.accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.availabilitysets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.diskencryptionsets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.galleries.images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.galleries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.virtualmachines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.compute.virtualmachinescalesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
2 changes: 0 additions & 2 deletions .github/workflows/ms.consumption.budgets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,3 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
1 change: 0 additions & 1 deletion .github/workflows/ms.containerregistry.registries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ jobs:
uses: ./.github/actions/templates/removeModule
with:
moduleName: '${{ env.moduleName }}'
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
resourceGroupName: '${{ env.resourceGroupName }}'
Loading