Skip to content

Commit

Permalink
add deploymentlevel support
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Dec 1, 2024
1 parent c545548 commit 84e15c0
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/config.msft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults:
global:
rg: b-gerdo-global-shared-resources
subscription: hcp-{{ .ctx.region }}
manageTokenCustomRole: false
manageTokenCustomRole: true
region: uksouth

# General AKS config
Expand Down
1 change: 1 addition & 0 deletions dev-infrastructure/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ configurations/dev-role-assignments.bicepparam
configurations/cs-integ-msi.bicepparam
configurations/mock-identities.bicepparam
configurations/global.bicepparam
configurations/global-roles.bicepparam
config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using '../templates/global-roles.bicep'

param manageTokenRole = {{ .global.manageTokenCustomRole }}
2 changes: 0 additions & 2 deletions dev-infrastructure/configurations/global.tmpl.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ param ocpAcrName = '{{ .ocpAcrName }}'
param ocpAcrSku = 'Premium'

param location = '{{ .global.region }}'

param manageTokenRole = {{ .global.manageTokenCustomRole }}
7 changes: 6 additions & 1 deletion dev-infrastructure/svc-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ resourceGroups:
- name: {{ .global.rg }}
subscription: {{ .global.subscription }}
steps:
- name: acr-ocp
- name: acr-ocp # rename to global
action: ARM
template: templates/global.bicep
parameters: configurations/global.tmpl.bicepparam
- name: global-roles
action: ARM
template: templates/global-roles.bicep
parameters: configurations/global-roles.tmpl.bicepparam
deploymentLevel: Subscription
7 changes: 7 additions & 0 deletions dev-infrastructure/templates/global-roles.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@description('Defines if the ACR token management role should be created')
param manageTokenRole bool

module tokenMgmtRole '../modules/acr/token-mgmt-role.bicep' = if (manageTokenRole) {
name: 'acr-token-mgmt-role'
scope: subscription()
}
7 changes: 0 additions & 7 deletions dev-infrastructure/templates/global.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ param svcAcrSku string

param location string

param manageTokenRole bool

module ocpAcr '../modules/acr/acr.bicep' = {
name: '${deployment().name}-${ocpAcrName}'
params: {
Expand All @@ -25,8 +23,3 @@ module svcAcr '../modules/acr/acr.bicep' = {
location: location
}
}

module tokenMgmtRole '../modules/acr/token-mgmt-role.bicep' = if (manageTokenRole) {
name: 'acr-token-mgmt-role'
scope: subscription()
}
1 change: 1 addition & 0 deletions tooling/templatize/pkg/pipeline/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Step struct {
Parameters string `yaml:"parameters,omitempty"`
DependsOn []string `yaml:"dependsOn,omitempty"`
DryRun DryRun `yaml:"dryRun,omitempty"`
DeploymentLevel string `yaml:"deploymentLevel,omitempty"`
outputFunc outPutHandler
}

Expand Down

0 comments on commit 84e15c0

Please sign in to comment.