Skip to content

Commit

Permalink
use plain makefiles
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Oct 26, 2024
1 parent aeff941 commit d79e988
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 48 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/aro-hcp-dev-what-if.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ jobs:

- name: 'Deployment What If'
run: |
dev-infrastructure/make ${DEPLOY_ENV} what-if
cd dev-infrastructure/
make what-if
3 changes: 2 additions & 1 deletion .github/workflows/cs-pr-what-if.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ jobs:

- name: 'Deployment What If'
run: |
dev-infrastructure/make ${DEPLOY_ENV} what-if
cd dev-infrastructure/
make what-if
4 changes: 2 additions & 2 deletions .github/workflows/dev-infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
working-directory: './dev-infrastructure'
run: |
az bicep version
make -f Makefile.lint.mk fmt
make -f Makefile.lint.mk lint
make fmt
make lint
- name: Check for uncommitted changes
working-directory: './dev-infrastructure'
Expand Down
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ fmt: $(GOIMPORTS)
#

infra.svc:
dev-infrastructure/make $(DEPLOY_ENV) svc.init
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) make svc.init

infra.mgmt:
dev-infrastructure/make $(DEPLOY_ENV) mgmt.init
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) make mgmt.init

infra.imagesync:
dev-infrastructure/make $(DEPLOY_ENV) imagesync
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) make imagesync

infra.all:
dev-infrastructure/make $(DEPLOY_ENV) infra
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) make infra

infra.svc.clean:
dev-infrastructure/make $(DEPLOY_ENV) svc.clean
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) svc.clean

infra.mgmt.clean:
dev-infrastructure/make $(DEPLOY_ENV) mgmt.clean
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) mgmt.clean

infra.region.clean:
dev-infrastructure/make $(DEPLOY_ENV) region.clean
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) region.clean

infra.imagesync.clean:
dev-infrastructure/make $(DEPLOY_ENV) imagesync.clean
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) imagesync.clean

infra.clean:
dev-infrastructure/make $(DEPLOY_ENV) clean
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) clean

#
# Cluster Service
Expand Down Expand Up @@ -112,4 +112,9 @@ deploy.mgmt.all: maestro.agent.deploy acm.deploy hypershift.deploy

deploy.all: deploy.svc.all deploy.mgmt.all

list:
@grep '^[^#[:space:]].*:' Makefile
.PHONY: list


.PHONY: all clean lint test fmt deploy.all deploy.svc.all deploy.mgmt.all acm.deploy hypershift.deploy rp.frontend.deploy rp.backend.deploy maestro.server.deploy maestro.agent.deploy maestro.registration.deploy maestro infra.svc infra.mgmt infra.imagesync infra.all infra.clean infra.region.clean infra.svc.clean infra.mgmt.clean
2 changes: 1 addition & 1 deletion dev-infrastructure/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
configurations/config.mk
configurations/mgmt-cluster.bicepparam
configurations/svc-cluster.bicepparam
configurations/region.bicepparam
Expand All @@ -7,3 +6,4 @@ configurations/acr-svc.bicepparam
configurations/acr-ocp.bicepparam
configurations/acr.bicepparam
configurations/image-sync.bicepparam
config.mk
24 changes: 21 additions & 3 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL = /bin/bash

include configurations/config.mk
include Makefile.lint.mk
DEPLOY_ENV ?= personal-dev
$(shell ../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk)
include config.mk

# Set SKIP_CONFIRM to a non-empty value to skip "what-if" confirmation prompts.
ifndef SKIP_CONFIRM
Expand All @@ -15,6 +15,24 @@ list:
@grep '^[^#[:space:]].*:' Makefile
.PHONY: list

fmt:
set -e; \
FILES="$$(find . -type f -name "*.bicep*")"; \
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*")"; \
for file in $$FILES; do \
echo "az bicep lint --file $${file}"; \
az bicep lint --file $$file; \
done
.PHONY: lint

feature-registration: # hardcoded to eastus as this is a subscription deployment, not a resource group
@az deployment sub create \
--name "feature-registration" \
Expand Down
17 changes: 0 additions & 17 deletions dev-infrastructure/Makefile.lint.mk

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions dev-infrastructure/docs/development-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Please not that these kubeconfig files require an active Azure CLI session (`az
If you loose these files, you can recreate them by running

```bash
dev-infrastructure/make svc.aks.admin-access svc.aks.kubeconfig
make -f dev-infrastructure/Makefile svc.aks.admin-access svc.aks.kubeconfig
or
dev-infrastructure/make mgmt.aks.admin-access mgmt.aks.kubeconfig
make -f dev-infrastructure/Makefile mgmt.aks.admin-access mgmt.aks.kubeconfig
```

> Freshly granted cluster admin permissions might not be effective immediately. If you get permission denied errors on your `kubectl` commands, consider waiting a couple of minutes for the permissons to be propagated
Expand Down
12 changes: 0 additions & 12 deletions dev-infrastructure/make

This file was deleted.

3 changes: 3 additions & 0 deletions tooling/templatize/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package config

import (
"bytes"
"fmt"
"os"
"text/template"

Expand Down Expand Up @@ -47,6 +48,8 @@ func (cp *configProviderImpl) GetVariables(cloud, deployEnv string) (Variables,
variables[k] = v
}
}
} else {
return nil, fmt.Errorf("the deployment env %s is not found under cloud %s in %s", deployEnv, cloud, cp.config)
}
}
}
Expand Down

0 comments on commit d79e988

Please sign in to comment.