From b04a7acffad2b0528e3528d82b3082fc52d365bb Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Boll Date: Mon, 6 Jan 2025 16:24:32 +0100 Subject: [PATCH 1/4] Backend add dry run --- .github/workflows/services-pr-check.yml | 6 ++++++ Makefile | 4 ++-- backend/Makefile | 3 ++- backend/pipeline.yaml | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/services-pr-check.yml b/.github/workflows/services-pr-check.yml index 794e1c920..1af5d69df 100644 --- a/.github/workflows/services-pr-check.yml +++ b/.github/workflows/services-pr-check.yml @@ -79,3 +79,9 @@ PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }} run: | make frontend.dry_run + + - name: 'Deploy Backend' + env: + PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }} + run: | + make backend.dry_run diff --git a/Makefile b/Makefile index 23bc5e776..53a6abadf 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ infra.clean: # separator "/" (used for maestro only). # Services deployed on "svc" aks cluster -services_svc = istio metrics maestro.server maestro.registration cluster-service backend +services_svc = istio metrics maestro.server maestro.registration cluster-service # Services deployed on "mgmt" aks cluster(s) services_mgmt = acm maestro.agent pko hypershiftoperator # List of all services @@ -124,7 +124,7 @@ services_all = $(join services_svc,services_mgmt) # Pipelines section # This sections is used to reference pipeline runs and should replace # the usage of `svc-deploh.sh` script in the future. -services_svc_pipelines = frontend +services_svc_pipelines = backend frontend %.deploy: $(eval export dirname=$(subst .,/,$(basename $@))) ./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public diff --git a/backend/Makefile b/backend/Makefile index ce689a792..ba44be9f3 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,4 +1,5 @@ -include ../setup-env.mk +-include ../helm-cmd.mk ifndef COMMIT COMMIT := $(shell git rev-parse --short=7 HEAD) @@ -41,7 +42,7 @@ deploy: DB_URL=$$(az cosmosdb show -n ${DB_NAME} -g ${RESOURCEGROUP} --query documentEndpoint -o tsv) && \ kubectl create namespace aro-hcp --dry-run=client -o json | kubectl apply -f - && \ kubectl label namespace aro-hcp "istio.io/rev=$${ISTO_VERSION}" --overwrite=true && \ - helm upgrade --install aro-hcp-backend-dev \ + ${HELM_CMD} aro-hcp-backend-dev \ deploy/helm/backend/ \ --set configMap.databaseName=${DB_NAME} \ --set configMap.databaseUrl="$${DB_URL}" \ diff --git a/backend/pipeline.yaml b/backend/pipeline.yaml index ae9b4537f..1e2220b98 100644 --- a/backend/pipeline.yaml +++ b/backend/pipeline.yaml @@ -9,6 +9,10 @@ resourceGroups: - name: deploy action: Shell command: make deploy + dryRun: + variables: + - name: DRY_RUN + value: "true" variables: - name: ARO_HCP_IMAGE_ACR configRef: svcAcrName From f8986a404ffa14d0b1298c92d2491b08bd41bca3 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Boll Date: Tue, 7 Jan 2025 08:51:42 +0100 Subject: [PATCH 2/4] Remove duplicate configuration line --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 53a6abadf..c4d73ba0b 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,6 @@ services_svc_pipelines = backend frontend $(eval export dirname=$(subst .,/,$(basename $@))) ./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public -services_svc_pipelines = frontend %.dry_run: $(eval export dirname=$(subst .,/,$(basename $@))) ./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public -d From bad73f209e0b51342a7bcf29405faa826a97c132 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Boll Date: Tue, 7 Jan 2025 09:41:16 +0100 Subject: [PATCH 3/4] Add a helm cmd fallback for ev2 generator --- backend/Makefile | 1 + frontend/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/Makefile b/backend/Makefile index ba44be9f3..36b1e1c0b 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,4 +1,5 @@ -include ../setup-env.mk +HELM_CMD ?= helm upgrade --install -include ../helm-cmd.mk ifndef COMMIT diff --git a/frontend/Makefile b/frontend/Makefile index d24fa2a90..978704967 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,4 +1,5 @@ -include ../setup-env.mk +HELM_CMD ?= helm upgrade --install -include ../helm-cmd.mk ifndef COMMIT From 0ddc6b166275e4e4f940a8df7d772ef0ca035f48 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Boll Date: Tue, 7 Jan 2025 10:06:11 +0100 Subject: [PATCH 4/4] Fix, define HELM_CMD after include --- backend/Makefile | 2 +- frontend/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Makefile b/backend/Makefile index 36b1e1c0b..89ebf5267 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,6 +1,6 @@ -include ../setup-env.mk -HELM_CMD ?= helm upgrade --install -include ../helm-cmd.mk +HELM_CMD ?= helm upgrade --install ifndef COMMIT COMMIT := $(shell git rev-parse --short=7 HEAD) diff --git a/frontend/Makefile b/frontend/Makefile index 978704967..1e177c3aa 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,6 +1,6 @@ -include ../setup-env.mk -HELM_CMD ?= helm upgrade --install -include ../helm-cmd.mk +HELM_CMD ?= helm upgrade --install ifndef COMMIT COMMIT := $(shell git rev-parse --short=7 HEAD)