Added Ordering Background Tasks deploy template and deploy pipeline
This commit is contained in:
parent
e37bafc489
commit
b66d5d0459
@ -0,0 +1,105 @@
|
||||
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: ConnectionString
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: ConnectionString
|
||||
name: ordering-db-connection-secret
|
||||
- name: EventBusConnection
|
||||
value: ${RABBITMQ_HOSTNAME}
|
||||
- name: UseCustomizationData
|
||||
value: true
|
||||
- name: CheckUpdateTime
|
||||
value: 30000
|
||||
- name: GracePeriodTime
|
||||
value: 1
|
||||
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: orderingbackgroundtasks
|
||||
- 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: ordering-backgroundtasks-deploy-template
|
||||
- description: The hostname of the RabbitMQ service
|
||||
displayName: RabbitMQ Hostname
|
||||
name: RABBITMQ_HOSTNAME
|
||||
required: true
|
35
deploy/aro/ordering-backgroundtasks/azure-pipelines.yml
Normal file
35
deploy/aro/ordering-backgroundtasks/azure-pipelines.yml
Normal file
@ -0,0 +1,35 @@
|
||||
variables:
|
||||
OpenShiftServiceConnection: 'OpenShift on ARO'
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- dev
|
||||
paths:
|
||||
include:
|
||||
- deploy/aro/ordering-backgroundtasks/*
|
||||
- deploy/aro/openshift-templates/*
|
||||
stages:
|
||||
- stage: development
|
||||
displayName: Development
|
||||
variables:
|
||||
OpenShiftProject: development
|
||||
SourceImageRegistryProjectName: development
|
||||
jobs:
|
||||
- job: OrderingBackgroundTasksDeployment
|
||||
displayName: 'Ordering Background Tasks 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/ordering-backgroundtasks-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) -p RABBITMQ_HOSTNAME=$(RabbitMqHostname) | oc apply -f-'
|
||||
failOnStderr: true
|
||||
displayName: 'Ensure Ordering Background Tasks OpenShift DeploymentConfig and Service'
|
Loading…
x
Reference in New Issue
Block a user