Skip to content

Commit

Permalink
dev-infrastructure: parallelize fmt, lint
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed Dec 19, 2024
1 parent 21d7769 commit e5bb0ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bicep-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
working-directory: './dev-infrastructure'
run: |
az bicep version
make fmt
make lint
make -j fmt
make -j lint
- name: Check for uncommitted changes
working-directory: './dev-infrastructure'
Expand Down
29 changes: 12 additions & 17 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,18 @@ list:
@grep '^[^#[:space:]].*:' Makefile
.PHONY: list

fmt:
set -e; \
FILES="$$(find . -type f -name "*.bicep*" ! -name "*.tmpl.bicepparam")"; \
for file in $$FILES; do \
echo "az bicep format --file $${file}"; \
az bicep format --file $$file; \
done
.PHONY: fmt

lint:
set -e; \
FILES="$$(find . -type f -name "*.bicep*" ! -name "*.tmpl.bicepparam")"; \
for file in $$FILES; do \
echo "az bicep lint --file $${file}"; \
az bicep lint --file $$file; \
done
.PHONY: lint
modules := $(wildcard ./templates/*.bicep)
parameters := $(filter-out $(wildcard ./templates/*.tmpl.bicepparam),$(wildcard ./templates/*.bicepparam))

fmt: $(modules:.bicep=.bicep.fmt) $(parameters:.bicepparam=.biceparam.fmt)

lint: $(modules:.bicep=.bicep.lint) $(parameters:.bicepparam=.biceparam.lint)

%.bicep.fmt %.bicepparam.fmt:
az bicep format --file $(basename $@)

%.bicep.lint %.bicepparam.lint:
az bicep lint --file $(basename $@)

feature-registration: # hardcoded to eastus as this is a subscription deployment, not a resource group
@az deployment sub create \
Expand Down
4 changes: 2 additions & 2 deletions dev-infrastructure/modules/aks-cluster-base.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ resource uami_fedcred 'Microsoft.ManagedIdentity/userAssignedIdentities/federate
]

resource pullerIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
location: location
name: 'image-puller'
location: location
name: 'image-puller'
}

module acrPullerRoles 'acr/acr-permissions.bicep' = [
Expand Down

0 comments on commit e5bb0ac

Please sign in to comment.