Browse Source

Added api-gw-deploy Azure Devops template and refactored all of the apigw apps to use that template

pull/1259/head
Tim McCarthy 5 years ago
parent
commit
7556ec472c
5 changed files with 48 additions and 94 deletions
  1. +32
    -0
      deploy/aro/azure-devops-templates/api-gw-deploy.yml
  2. +4
    -28
      deploy/aro/mobilemarketingapigw/azure-pipelines.yml
  3. +4
    -22
      deploy/aro/mobileshoppingapigw/azure-pipelines.yml
  4. +4
    -22
      deploy/aro/webmarketingapigw/azure-pipelines.yml
  5. +4
    -22
      deploy/aro/webshoppingapigw/azure-pipelines.yml

+ 32
- 0
deploy/aro/azure-devops-templates/api-gw-deploy.yml View File

@ -0,0 +1,32 @@
parameters:
AppName: ''
AppTitle: ''
jobs:
- job: ApiGatewayDeployment
displayName: '$(AppTitle) Deployment'
variables:
- template: ./deploy/aro/azure-devops-templates/variables.yml
pool:
vmImage: 'windows-latest'
steps:
- task: colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens@1
displayName: 'Replace tokens in envoy.yaml'
inputs:
sourcePath: ./deploy/aro/$(AppName)
filePattern: envoy.yaml
- task: redhat.openshift-vsts.oc-setup-task.oc-setup@2
displayName: 'Setup Openshift CLI'
inputs:
openshiftService: $(OpenShiftServiceConnection)
- script: 'oc project $(OpenShiftProject)'
failOnStderr: true
displayName: 'Set OpenShift Project Context'
- script: 'oc delete configmap $(AppName)-config-map'
failOnStderr: false
displayName: 'Delete Envoy ConfigMap'
- script: 'oc create configmap $(AppName)-config-map --from-file=./deploy/aro/$(AppName)/envoy.yaml'
failOnStderr: true
displayName: 'Create Envoy ConfigMap'
- script: 'oc process -f ./deploy/aro/apigw-templates/apigw-deploy-template.yml -p APPLICATION_NAME=$(AppName) -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-'
failOnStderr: true
displayName: 'Ensure $(AppTitle) OpenShift Application'

+ 4
- 28
deploy/aro/mobilemarketingapigw/azure-pipelines.yml View File

@ -16,31 +16,7 @@ stages:
SourceImageRegistryProjectName: development
EnvironmentName: -dev.msftnbu.com
jobs:
- job: MobileMarketingApiGatewayDeployment
displayName: 'Mobile Marketing API Gateway Deployment'
variables:
- template: ../azure-devops-templates/variables.yml
pool:
vmImage: 'windows-latest'
steps:
- task: colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens@1
displayName: 'Replace tokens in envoy.yaml'
inputs:
sourcePath: ./deploy/aro/mobilemarketingapigw
filePattern: envoy.yaml
- task: redhat.openshift-vsts.oc-setup-task.oc-setup@2
displayName: 'Setup Openshift CLI'
inputs:
openshiftService: $(OpenShiftServiceConnection)
- script: 'oc project $(OpenShiftProject)'
failOnStderr: true
displayName: 'Set OpenShift Project Context'
- script: 'oc delete configmap mobilemarketingapigw-config-map'
failOnStderr: false
displayName: 'Delete Envoy ConfigMap'
- script: 'oc create configmap mobilemarketingapigw-config-map --from-file=./deploy/aro/mobilemarketingapigw/envoy.yml'
failOnStderr: true
displayName: 'Create Envoy ConfigMap'
- script: 'oc process -f ./deploy/aro/apigw-templates/apigw-deploy-template.yml -p APPLICATION_NAME=mobilemarketingapigw -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-'
failOnStderr: true
displayName: 'Ensure Mobile Marketing API Gateway OpenShift DeploymentConfig and Service'
- template: ./deploy/aro/azure-devops-templates/api-gw-deploy.yml
parameters:
AppName: mobilemarketingapigw
AppTitle: 'Mobile Marketing API Gateway'

+ 4
- 22
deploy/aro/mobileshoppingapigw/azure-pipelines.yml View File

@ -16,25 +16,7 @@ stages:
SourceImageRegistryProjectName: development
EnvironmentName: -dev.msftnbu.com
jobs:
- job: MobileShoppingApiGatewayDeployment
displayName: 'Mobile Shopping API Gateway Deployment'
variables:
- template: ../azure-devops-templates/variables.yml
pool:
vmImage: 'windows-latest'
steps:
- task: colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens@1
displayName: 'Replace tokens in envoy.yml'
inputs:
sourcePath: ./deploy/aro/mobileshoppingapigw
filePattern: envoy.yml
- task: redhat.openshift-vsts.oc-setup-task.oc-setup@2
displayName: 'Setup Openshift CLI'
inputs:
openshiftService: $(OpenShiftServiceConnection)
- script: 'oc project $(OpenShiftProject)'
failOnStderr: true
displayName: 'Set OpenShift Project Context'
- script: 'oc process -f ./deploy/aro/apigw-templates/apigw-deploy-template.yml -p APPLICATION_NAME=mobileshoppingapigw -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-'
failOnStderr: true
displayName: 'Ensure Mobile Shopping API Gateway OpenShift DeploymentConfig and Service'
- template: ./deploy/aro/azure-devops-templates/api-gw-deploy.yml
parameters:
AppName: mobileshoppingapigw
AppTitle: 'Mobile Shopping API Gateway'

+ 4
- 22
deploy/aro/webmarketingapigw/azure-pipelines.yml View File

@ -16,25 +16,7 @@ stages:
SourceImageRegistryProjectName: development
EnvironmentName: -dev.msftnbu.com
jobs:
- job: WebMarketingApiGatewayDeployment
displayName: 'Web Marketing API Gateway Deployment'
variables:
- template: ../azure-devops-templates/variables.yml
pool:
vmImage: 'windows-latest'
steps:
- task: colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens@1
displayName: 'Replace tokens in envoy.yml'
inputs:
sourcePath: ./deploy/aro/webmarketingapigw
filePattern: envoy.yml
- task: redhat.openshift-vsts.oc-setup-task.oc-setup@2
displayName: 'Setup Openshift CLI'
inputs:
openshiftService: $(OpenShiftServiceConnection)
- script: 'oc project $(OpenShiftProject)'
failOnStderr: true
displayName: 'Set OpenShift Project Context'
- script: 'oc process -f ./deploy/aro/apigw-templates/apigw-deploy-template.yml -p APPLICATION_NAME=webmarketingapigw -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-'
failOnStderr: true
displayName: 'Ensure Web Marketing API Gateway OpenShift DeploymentConfig and Service'
- template: ./deploy/aro/azure-devops-templates/api-gw-deploy.yml
parameters:
AppName: webmarketingapigw
AppTitle: 'Web Marketing API Gateway'

+ 4
- 22
deploy/aro/webshoppingapigw/azure-pipelines.yml View File

@ -16,25 +16,7 @@ stages:
SourceImageRegistryProjectName: development
EnvironmentName: -dev.msftnbu.com
jobs:
- job: WebShoppingApiGatewayDeployment
displayName: 'Web Shopping API Gateway Deployment'
variables:
- template: ../azure-devops-templates/variables.yml
pool:
vmImage: 'windows-latest'
steps:
- task: colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens@1
displayName: 'Replace tokens in envoy.yml'
inputs:
sourcePath: ./deploy/aro/webshoppingapigw
filePattern: envoy.yml
- task: redhat.openshift-vsts.oc-setup-task.oc-setup@2
displayName: 'Setup Openshift CLI'
inputs:
openshiftService: $(OpenShiftServiceConnection)
- script: 'oc project $(OpenShiftProject)'
failOnStderr: true
displayName: 'Set OpenShift Project Context'
- script: 'oc process -f ./deploy/aro/apigw-templates/apigw-deploy-template.yml -p APPLICATION_NAME=webshoppingapigw -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-'
failOnStderr: true
displayName: 'Ensure Web Shopping API Gateway OpenShift DeploymentConfig and Service'
- template: ./deploy/aro/azure-devops-templates/api-gw-deploy.yml
parameters:
AppName: webshoppingapigw
AppTitle: 'Web Shopping API Gateway'

Loading…
Cancel
Save