From fe4236ee6227303b2436374f479ecd7ac5a04ea8 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Thu, 20 Feb 2020 17:00:08 -0800 Subject: [PATCH] Added variables template; wired up basketapi and identityapi deploy pipelines to use the new variables template --- deploy/aro/azure-devops-templates/variables.yml | 7 +++++++ deploy/aro/basket-api/azure-pipelines.yml | 8 ++------ deploy/aro/identity-api/azure-pipelines.yml | 10 +++------- 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 deploy/aro/azure-devops-templates/variables.yml diff --git a/deploy/aro/azure-devops-templates/variables.yml b/deploy/aro/azure-devops-templates/variables.yml new file mode 100644 index 000000000..9b1257e20 --- /dev/null +++ b/deploy/aro/azure-devops-templates/variables.yml @@ -0,0 +1,7 @@ +variables: + IdentityApiHostName: identityapi.$(OpenShiftProject).svc + RedisHostname: redis.$(OpenShiftProject).svc + RabbitMqHostname: rabbitmq.$(OpenShiftProject).svc + IdentityPublicHostName: identity$(EnvironmentName) + IdentityUrlExternal: https://$(IdentityPublicHostName) + IdentityApiUrl: http://$(IdentityApiHostName):8080 \ No newline at end of file diff --git a/deploy/aro/basket-api/azure-pipelines.yml b/deploy/aro/basket-api/azure-pipelines.yml index 325d45de3..dc5206611 100644 --- a/deploy/aro/basket-api/azure-pipelines.yml +++ b/deploy/aro/basket-api/azure-pipelines.yml @@ -23,13 +23,9 @@ stages: IdentityPublicHostName: identity$(EnvironmentName) jobs: - job: BasketApiDeployment - variables: - IdentityApiHostName: identityapi.$(OpenShiftProject).svc - RedisHostname: redis.$(OpenShiftProject).svc - RabbitMqHostname: rabbitmq.$(OpenShiftProject).svc - IdentityUrlExternal: https://$(IdentityPublicHostName) - IdentityApiUrl: http://$(IdentityApiHostName):8080 displayName: 'Basket API Deployment' + variables: + - template: ../azure-devops-templates/variables.yml pool: vmImage: 'windows-latest' steps: diff --git a/deploy/aro/identity-api/azure-pipelines.yml b/deploy/aro/identity-api/azure-pipelines.yml index 14ec5405d..8aa3686ff 100644 --- a/deploy/aro/identity-api/azure-pipelines.yml +++ b/deploy/aro/identity-api/azure-pipelines.yml @@ -20,15 +20,11 @@ stages: OpenShiftProject: development SourceImageRegistryProjectName: $(OpenShiftProject) EnvironmentName: dev - IdentityApiHostName: identityapi.$(OpenShiftProject).svc - RedisHostname: redis.$(OpenShiftProject).svc - RabbitMqHostname: rabbitmq.$(OpenShiftProject).svc - IdentityPublicHostName: identity$(EnvironmentName) - IdentityUrlExternal: https://$(IdentityPublicHostName) - IdentityApiUrl: http://$(IdentityApiHostName):8080 jobs: - job: Configuration_Deployment displayName: 'Configuration Deployment' + variables: + - template: ../azure-devops-templates/variables.yml pool: vmImage: 'windows-latest' steps: @@ -39,6 +35,6 @@ stages: - script: 'oc project $(OpenShiftProject)' failOnStderr: true displayName: 'Set OpenShift Project Context' - - script: 'oc process -f ./deploy/aro/openshift-templates/identityapi-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' + - script: 'oc process -f ./deploy/aro/openshift-templates/identityapi-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) -p WEB_SPA_URL= -p WEB_MVC_URL= -p LOCATION_API_URL= -p MARKETING_API_URL= -p BASKET_API_URL= -p ORDERING_API_URL= -p MOBILE_SHOPPING_AGGREGATOR_URL= -p WEB_SHOPPING_AGGREGATOR_URL= -p WEBHOOKS_API_URL= -p WEBHOOKS_WEB_CLIENT_URL= | oc apply -f-' failOnStderr: true displayName: 'Ensure Identity API OpenShift DeploymentConfig and Service' \ No newline at end of file