-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templatize only Makefile include not makefile itself
Signed-off-by: Gerd Oberlechner <[email protected]>
- Loading branch information
Showing
24 changed files
with
159 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Makefile | ||
config.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARO_HCP_IMAGE_ACR ?= {{ .acrName }} | ||
LOCATION ?= {{ .region }} | ||
RESOURCEGROUP ?= {{ .serviceClusterRG }} | ||
AKS_NAME ?= {{ .aksName }} | ||
DB_NAME ?= {{ .frontendCosmosDBName }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
deploy/tmp-provisioning-shard.yml | ||
Makefile | ||
config.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
SHELL = /bin/bash | ||
DEPLOY_ENV ?= personal-dev | ||
|
||
$(shell ../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) | ||
|
||
include config.mk | ||
|
||
ZONE_RESOURCE_ID ?= $(shell az network dns zone show -n ${DNS_ZONE_NAME} -g ${REGIONAL_RESOURCEGROUP} --query id -o tsv) | ||
|
||
deploy: | ||
sed -e "s#ZONE_RESOURCE_ID#${ZONE_RESOURCE_ID}#g" -e "s/REGION/${REGION}/g" -e "s/CONSUMER_NAME/${CONSUMER_NAME}/g" deploy/mvp-provisioning-shards.yml > deploy/tmp-provisioning-shard.yml | ||
|
||
ISTO_VERSION=$(shell az aks show -n ${AKS_NAME} -g ${RESOURCEGROUP} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \ | ||
oc process --local -f deploy/openshift-templates/arohcp-namespace-template.yml \ | ||
-p ISTIO_VERSION=$${ISTO_VERSION} | oc apply -f - | ||
kubectl apply -f deploy/istio.yml | ||
|
||
oc process --local -f deploy/openshift-templates/arohcp-db-template.yml | oc apply -f - | ||
oc process --local -f deploy/openshift-templates/arohcp-secrets-template.yml \ | ||
-p PROVISION_SHARDS_CONFIG="$$( base64 -i deploy/tmp-provisioning-shard.yml)" | oc apply -f - | ||
|
||
AZURE_CS_MI_CLIENT_ID=$(shell az identity show -g ${RESOURCEGROUP} -n clusters-service --query clientId -o tsv) && \ | ||
CS_SERVICE_PRINCIPAL_CREDS_BASE64='$(shell az keyvault secret show --vault-name "${SERVICE_KV}" --name "aro-hcp-dev-sp-cs" | jq .value -r | base64 | tr -d '\n')' && \ | ||
TENANT_ID=$(shell az account show --query tenantId --output tsv) && \ | ||
OIDC_BLOB_SERVICE_ENDPOINT=$(shell az storage account show -n ${OIDC_STORAGE_ACCOUNT} -g ${RESOURCEGROUP} --query primaryEndpoints.blob -o tsv) && \ | ||
OIDC_WEB_SERVICE_ENDPOINT=$(shell az storage account show -n ${OIDC_STORAGE_ACCOUNT} -g ${RESOURCEGROUP} --query primaryEndpoints.web -o tsv) && \ | ||
oc process --local -f deploy/openshift-templates/arohcp-service-template.yml \ | ||
-p AZURE_CS_MI_CLIENT_ID=$${AZURE_CS_MI_CLIENT_ID} \ | ||
-p TENANT_ID=$${TENANT_ID} \ | ||
-p REGION=${REGION} \ | ||
-p SERVICE_KEYVAULT_NAME=${SERVICE_KV} \ | ||
-p CS_SERVICE_PRINCIPAL_CREDS_BASE64=$${CS_SERVICE_PRINCIPAL_CREDS_BASE64} \ | ||
-p IMAGE_REGISTRY=${ACR_NAME}.azurecr.io \ | ||
-p IMAGE_REPOSITORY=${IMAGE_REPO} \ | ||
-p AZURE_FIRST_PARTY_APPLICATION_CLIENT_ID=${FPA_CLIENT_ID} \ | ||
-p FPA_CERT_NAME=${FPA_CERT_NAME} \ | ||
-p IMAGE_TAG=${IMAGE_TAG} | oc apply -f - | ||
|
||
deploy-pr-env-deps: | ||
AZURE_CS_MI_CLIENT_ID=$(shell az identity show -g ${RESOURCEGROUP} -n clusters-service --query clientId -o tsv) && \ | ||
oc process --local -f deploy/integration/cluster-service-namespace.yaml \ | ||
-p CLIENT_ID=${AZURE_CS_MI_CLIENT_ID} | oc apply -f - | ||
|
||
# for local development | ||
provision-shard: | ||
sed -e "s#ZONE_RESOURCE_ID#${ZONE_RESOURCE_ID}#g" -e "s/REGION/${REGION}/g" -e "s/CONSUMER_NAME/${CONSUMER_NAME}/g" deploy/dev-provisioning-shards.yml | ||
|
||
.PHONY: deploy deploy-integ provision-shard |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
REGION ?= {{ .region }} | ||
CONSUMER_NAME ?= {{ .maestroConsumerName }} | ||
RESOURCEGROUP ?= {{ .serviceClusterRG }} | ||
REGIONAL_RESOURCEGROUP ?= {{ .regionRG }} | ||
AKS_NAME ?= {{ .aksName }} | ||
SERVICE_KV ?= {{ .serviceKeyVaultName }} | ||
OIDC_STORAGE_ACCOUNT ?= {{ .oidcStorageAccountName }} | ||
IMAGE_REPO ?= {{ .clusterServiceImageRepo }} | ||
IMAGE_TAG ?= {{ .clusterServiceImageTag }} | ||
ACR_NAME ?= {{ .acrName }} | ||
FPA_CLIENT_ID ?= {{ .firstPartyAppClientId }} | ||
DNS_ZONE_NAME ?= {{ .regionalDNSSubdomain }}.{{ .baseDnsZoneName }} | ||
FPA_CERT_NAME ?= firstPartyCert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Makefile | ||
config.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARO_HCP_IMAGE_ACR ?= {{ .acrName }} | ||
LOCATION ?= {{ .region }} | ||
RESOURCEGROUP ?= {{ .serviceClusterRG }} | ||
AKS_NAME ?= {{ .aksName }} | ||
DB_NAME ?= {{ .frontendCosmosDBName }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
**/Makefile | ||
**/config.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SHELL = /bin/bash | ||
DEPLOY_ENV ?= personal-dev | ||
$(shell ../../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) | ||
include config.mk | ||
|
||
deploy: | ||
helm upgrade --install maestro-agent ./helm \ | ||
--create-namespace --namespace maestro \ | ||
--set consumerName=${CONSUMER_NAME} \ | ||
--set broker.host=${EVENTGRID_HOSTNAME} \ | ||
--set credsKeyVault.name=${KEYVAULT_NAME} \ | ||
--set credsKeyVault.secret=${CONSUMER_NAME} \ | ||
--set azure.clientId=${MAESTRO_MI_CLIENT_ID} \ | ||
--set azure.tenantId=${TENANT_ID} \ | ||
--set image.base=${IMAGE_BASE} \ | ||
--set image.tag=${IMAGE_TAG} | ||
.PHONY: deploy |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
TENANT_ID=$(shell az account show --query tenantId --output tsv) | ||
CONSUMER_NAME ?= {{ .maestroConsumerName }} | ||
EVENTGRID_HOSTNAME=$(shell az resource show -n {{ .maestroEventgridName }} -g {{ .regionRG }} --resource-type "Microsoft.EventGrid/namespaces" --query properties.topicSpacesConfiguration.hostname -o tsv) | ||
MAESTRO_MI_CLIENT_ID=$(shell az identity show -g "{{ .managementClusterRG }}" -n maestro-consumer --query clientId -o tsv) | ||
KEYVAULT_NAME ?= {{ .maestroKeyVaultName }} | ||
IMAGE_BASE ?= {{ .maestroImageBase }} | ||
IMAGE_TAG ?= {{ .maestroImageTag }} |
7 changes: 5 additions & 2 deletions
7
maestro/registration/Makefile.tmpl.mk → maestro/registration/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
SHELL = /bin/bash | ||
DEPLOY_ENV ?= personal-dev | ||
$(shell ../../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) | ||
include config.mk | ||
|
||
deploy: | ||
@if ! kubectl get service maestro -n maestro > /dev/null 2>&1; then \ | ||
echo "Error: Service 'maestro' not found in namespace 'maestro'"; \ | ||
exit 1; \ | ||
fi | ||
helm upgrade --install {{ .maestroConsumerName }} ./helm \ | ||
helm upgrade --install ${CONSUMER_NAME} ./helm \ | ||
--namespace maestro \ | ||
--set consumerName={{ .maestroConsumerName }} | ||
--set consumerName=${CONSUMER_NAME} | ||
.PHONY: deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONSUMER_NAME ?= {{ .maestroConsumerName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
SHELL = /bin/bash | ||
DEPLOY_ENV ?= personal-dev | ||
$(shell ../../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) | ||
include config.mk | ||
|
||
deploy: | ||
kubectl create namespace maestro --dry-run=client -o json | kubectl apply -f - | ||
kubectl label namespace maestro "istio.io/rev=${ISTO_VERSION}" --overwrite=true | ||
helm upgrade --install maestro-server ./helm \ | ||
--namespace maestro \ | ||
--set broker.host=${EVENTGRID_HOSTNAME} \ | ||
--set credsKeyVault.name=${KEYVAULT_NAME} \ | ||
--set azure.clientId=${MAESTRO_MI_CLIENT_ID} \ | ||
--set azure.tenantId=${TENANT_ID} \ | ||
--set istio.restrictIngress=${ISTIO_RESTRICT_INGRESS} \ | ||
--set image.base=${IMAGE_BASE} \ | ||
--set image.tag=${IMAGE_TAG} \ | ||
--set database.containerizedDb=${USE_CONTAINERIZED_DB} \ | ||
--set database.ssl='${USE_DATABASE_SSL}' | ||
.PHONY: deploy |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
TENANT_ID=$(shell az account show --query tenantId --output tsv) | ||
MAESTRO_MI_CLIENT_ID=$(shell az identity show -g "{{ .serviceClusterRG }}" -n maestro-server --query clientId -o tsv) | ||
EVENTGRID_HOSTNAME=$(shell az resource show -n {{ .maestroEventgridName }} -g {{ .regionRG }} --resource-type "Microsoft.EventGrid/namespaces" --query properties.topicSpacesConfiguration.hostname -o tsv) | ||
ISTO_VERSION=$(shell az aks show -n {{ .aksName }} -g {{ .serviceClusterRG }} --query serviceMeshProfile.istio.revisions[-1] -o tsv) | ||
IMAGE_BASE ?= {{ .maestroImageBase }} | ||
IMAGE_TAG ?= {{ .maestroImageTag }} | ||
USE_CONTAINERIZED_DB ?= {{ not .maestroPostgresDeploy }} | ||
USE_DATABASE_SSL ?= {{ ternary "enable" "disable" .maestroPostgresDeploy }} | ||
ISTIO_RESTRICT_INGRESS ?= {{ .maestroRestrictIstioIngress }} | ||
KEYVAULT_NAME ?= {{ .maestroKeyVaultName }} |
Oops, something went wrong.