From 4df4db70ac46dd0fe5bd4678ee5d12ef2b97fc25 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Wed, 19 Feb 2020 10:55:57 -0800 Subject: [PATCH] Added and changed the build pipelines; added identityapi deploy template --- build/aro/catalog-api/azure-pipelines.yml | 6 + build/aro/identity-api/azure-pipelines.yml | 6 + .../identityapi-deploy-template.yml | 124 ++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 deploy/aro/openshift-templates/identityapi-deploy-template.yml diff --git a/build/aro/catalog-api/azure-pipelines.yml b/build/aro/catalog-api/azure-pipelines.yml index ea045dc22..4b06f44f0 100644 --- a/build/aro/catalog-api/azure-pipelines.yml +++ b/build/aro/catalog-api/azure-pipelines.yml @@ -16,3 +16,9 @@ jobs: - template: ../webapp-build-artifacts.yml parameters: ProjectName: $(ProjectName) +- template: ../webapp-container-build.yml + parameters: + ProjectName: $(ProjectName) + OpenShiftProject: $(OpenShiftProject) + AppName: $(AppName) + OpenShiftServiceConnection: $(OpenShiftServiceConnection) diff --git a/build/aro/identity-api/azure-pipelines.yml b/build/aro/identity-api/azure-pipelines.yml index 7969ad943..60462107f 100644 --- a/build/aro/identity-api/azure-pipelines.yml +++ b/build/aro/identity-api/azure-pipelines.yml @@ -16,3 +16,9 @@ jobs: - template: ../webapp-build-artifacts.yml parameters: ProjectName: $(ProjectName) +- template: ../webapp-container-build.yml + parameters: + ProjectName: $(ProjectName) + OpenShiftProject: $(OpenShiftProject) + AppName: $(AppName) + OpenShiftServiceConnection: $(OpenShiftServiceConnection) diff --git a/deploy/aro/openshift-templates/identityapi-deploy-template.yml b/deploy/aro/openshift-templates/identityapi-deploy-template.yml new file mode 100644 index 000000000..e4b00ac98 --- /dev/null +++ b/deploy/aro/openshift-templates/identityapi-deploy-template.yml @@ -0,0 +1,124 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: ${TEMPLATE_NAME} +objects: +- apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + replicas: 1 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + strategy: + type: Rolling + revisionHistoryLimit: 2 + template: + metadata: + labels: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + spec: + containers: + - env: + - name: IdentityUrlExternal + value: ${IDENTITY_URL_EXTERNAL} + - name: IdentityUrl + value: ${IDENTITY_URL} + - name: ConnectionString + value: ${REDIS_HOSTNAME} + - name: EventBusConnection + value: ${RABBITMQ_HOSTNAME} + - name: PORT + value: "8080" + - name: GRPC_PORT + value: "8081" + - name: PATH_BASE + value: /basket-api + image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest + imagePullPolicy: Always + name: ${APPLICATION_NAME} + ports: + - containerPort: 8080 + protocol: TCP + - containerPort: 8081 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APPLICATION_NAME} + from: + kind: ImageStreamTag + name: ${APPLICATION_NAME}:latest + namespace: ${IMAGE_REGISTRY_PROJECT_NAME} + type: ImageChange +- apiVersion: v1 + kind: Service + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + ports: + - name: 8080-tcp + port: 8080 + protocol: TCP + targetPort: 8080 + - name: 8081-tcp-grpc + port: 8081 + protocol: TCP + targetPort: 8081 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} +parameters: +- description: The name for the application. + displayName: Application Name + name: APPLICATION_NAME + required: true + value: identityapi +- description: The OpenShift project name that is hosting the image registry. + displayName: Image Registry Project Name + name: IMAGE_REGISTRY_PROJECT_NAME + required: true +- description: The template name. + displayName: Template Name + name: TEMPLATE_NAME + required: true + value: basketapi-deploy-template +- description: The external URL of the Identity endpoint + displayName: Identity URL External + name: IDENTITY_URL_EXTERNAL + required: true +- description: The cluster internal URL of the Identity endpoint + displayName: Identity URL + name: IDENTITY_URL + required: true +- description: The hostname of the Redis service + displayName: Redis Hostname + name: REDIS_HOSTNAME + required: true +- description: The hostname of the RabbitMQ service + displayName: RabbitMQ Hostname + name: RABBITMQ_HOSTNAME + required: true