Skip to content

Commit

Permalink
Merge pull request #1034 from Azure/backend-add-dry-run
Browse files Browse the repository at this point in the history
Backend add dry run
  • Loading branch information
janboll authored Jan 7, 2025
2 parents 3c8c9e4 + 0ddc6b1 commit a4a3dc6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/services-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -124,12 +124,11 @@ 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

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
Expand Down
4 changes: 3 additions & 1 deletion backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-include ../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

ifndef COMMIT
COMMIT := $(shell git rev-parse --short=7 HEAD)
Expand Down Expand Up @@ -41,7 +43,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}" \
Expand Down
4 changes: 4 additions & 0 deletions backend/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions frontend/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-include ../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

ifndef COMMIT
COMMIT := $(shell git rev-parse --short=7 HEAD)
Expand Down

0 comments on commit a4a3dc6

Please sign in to comment.