Browse Source

Added Webhooks Client deploy template and deploy pipeline

pull/1259/head
Tim McCarthy 5 years ago
parent
commit
ba0f391754
3 changed files with 151 additions and 0 deletions
  1. +1
    -0
      deploy/aro/azure-devops-templates/variables.yml
  2. +114
    -0
      deploy/aro/openshift-templates/webhooks-client-deploy-template.yml
  3. +36
    -0
      deploy/aro/webhooks-client/azure-pipelines.yml

+ 1
- 0
deploy/aro/azure-devops-templates/variables.yml View File

@ -52,6 +52,7 @@ variables:
WebhooksApiUrl: http://$(WebhooksApiHostName):8080 WebhooksApiUrl: http://$(WebhooksApiHostName):8080
WebhooksWebClientHostName: webhookclient.$(OpenShiftProject).svc WebhooksWebClientHostName: webhookclient.$(OpenShiftProject).svc
WebhooksWebClientUrl: http://$(WebhooksWebClientHostName):8080 WebhooksWebClientUrl: http://$(WebhooksWebClientHostName):8080
WebhooksToken: 6168DB8D-DC58-4094-AF24-483278923590
WebSpaUrl: https://eshop-spa$(EnvironmentName) WebSpaUrl: https://eshop-spa$(EnvironmentName)
WebSpaHc: $(WebSpaUrl)/hc WebSpaHc: $(WebSpaUrl)/hc
WebMvcUrl: https://$(PublicHostName) WebMvcUrl: https://$(PublicHostName)


+ 114
- 0
deploy/aro/openshift-templates/webhooks-client-deploy-template.yml View File

@ -0,0 +1,114 @@
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: Token
value: ${WEBHOOKS_TOKEN}
- name: IdentityUrl
value: ${IDENTITY_API_URL}
- name: CallBackUrl
value: ${WEBHOOKS_WEB_CLIENT_URL}
- name: WebhooksUrl
value: ${WEBHOOKS_API_URL}
- name: SelfUrl
value: ${WEBHOOKS_WEB_CLIENT_URL}
image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
imagePullPolicy: Always
name: ${APPLICATION_NAME}
ports:
- containerPort: 8080
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
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: webhooksclient
- 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: webhooks-client-deploy-template
- description: Webhooks are registered with this token
displayName: Webhooks Token
name: WEBHOOKS_TOKEN
required: true
- description: The cluster internal URL of the Identity endpoint
displayName: Identity URL
name: IDENTITY_API_URL
required: true
- description: The cluster internal URL of the Webhooks API endpoint
displayName: Webhooks API URL
name: WEBHOOKS_API_URL
required: true
- description: The cluster internal URL of the Webhooks Client endpoint
displayName: Webhooks Client URL
name: WEBHOOKS_WEB_CLIENT_URL
required: true

+ 36
- 0
deploy/aro/webhooks-client/azure-pipelines.yml View File

@ -0,0 +1,36 @@
variables:
OpenShiftServiceConnection: 'OpenShift on ARO'
trigger:
branches:
include:
- master
- dev
paths:
include:
- deploy/aro/web-mvc/*
- deploy/aro/openshift-templates/*
stages:
- stage: development
displayName: Development
variables:
OpenShiftProject: development
SourceImageRegistryProjectName: development
EnvironmentName: dev
jobs:
- job: WebhooksClientDeployment
displayName: 'Webhooks Client Deployment'
variables:
- template: ../azure-devops-templates/variables.yml
pool:
vmImage: 'windows-latest'
steps:
- 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/openshift-templates/webhooks-client-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) -p WEBHOOKS_TOKEN=$(WebhooksToken) -p IDENTITY_API_URL=$(IdentityApiUrl) -p WEBHOOKS_WEB_CLIENT_URL=$(WebhooksWebClientUrl) -p WEBHOOKS_API_URL=$(WebhooksApiUrl) | oc apply -f-'
failOnStderr: true
displayName: 'Ensure Webhooks Client OpenShift DeploymentConfig and Service'

Loading…
Cancel
Save