Skip to content

Commit

Permalink
Fix AKSCONFIG variable check
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Shen <[email protected]>
  • Loading branch information
mjlshen committed May 8, 2024
1 parent 2e01baa commit 6ffbb32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/dev-infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ on:
branches:
- main
paths:
- 'dev-infrastructure/**'
- "dev-infrastructure/**"

jobs:
validate_bicep:
permissions:
contents: 'read'
contents: "read"
runs-on: ubuntu-latest

steps:
Expand All @@ -24,13 +24,14 @@ jobs:
fetch-depth: 1
sparse-checkout: dev-infrastructure

- name: 'az bicep format and lint'
working-directory: './dev-infrastructure'
- name: "az bicep format and lint"
working-directory: "./dev-infrastructure"
run: |
az bicep upgrade
make fmt
make lint
- name: Check for uncommitted changes
working-directory: './dev-infrastructure'
working-directory: "./dev-infrastructure"
run: |
git diff --exit-code || (echo "::error::Uncommitted changes detected in OpenAPI spec. Please regenerate and commit them." && exit 1)
16 changes: 4 additions & 12 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,11 @@ lint:
az bicep lint --file $$file; \
done

show:
@echo "Resource group : $(RESOURCEGROUP)"
@echo "VPN resource group : $(VPNRESOURCEGROUP)"
@echo "AddressSpace prefix : $(PREFIX)"
@echo "AKS version : $(AKSVERSION)"
@echo "Location : $(LOCATION)"
@echo "AKS VNet Name : $(AKSVNETNAME)"
@echo "DNSZone/deployment : $(DEPLOYMENTNAME)"

setsubscription:
ifndef AKSCONFIG
$(error "Must set AKSCONFIG")
endif
if [[ -z $$AKSCONFIG ]]; then \
echo "Must set AKSCONFIG"; \
exit 1; \
fi
az account set --subscription $(HCPDEVSUBSCRIPTION)
az account show

Expand Down

0 comments on commit 6ffbb32

Please sign in to comment.