Ajuste para exibir rota

This commit is contained in:
Alex Baptista 2018-02-28 12:59:58 -03:00
parent 20fd117b1e
commit 9d74285758

View file

@ -13,43 +13,44 @@ metadata:
tags: petclinic-web-app,java tags: petclinic-web-app,java
name: petclinic-web-app name: petclinic-web-app
parameters: parameters:
- name: APP_NAME - description: The name assigned to all of the application objects defined in this template.
description: The name assigned to all of the application objects defined in this template.
displayName: Application Name displayName: Application Name
name: APP_NAME
required: true required: true
value: petclinic-web-app value: petclinic-web-app
- name: APPLICATION_DOMAIN - description: The source URL for the application
description: Application URL
displayName: Application URL
- name: GIT_SOURCE_URL
description: The source URL for the application
displayName: Source URL displayName: Source URL
name: GIT_SOURCE_URL
required: true required: true
value: https://github.com/alexbaptista/spring-petclinic.git value: https://github.com/alexbaptista/spring-petclinic.git
- name: GIT_SOURCE_REF - description: The source Ref for the application
description: The source Ref for the application
displayName: Source Ref displayName: Source Ref
name: GIT_SOURCE_REF
required: true required: true
value: master value: master
- description: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted. - description: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted.
displayName: GitHub Webhook Secret displayName: GitHub Webhook Secret
name: GITHUB_WEBHOOK_SECRET
from: '[a-zA-Z0-9]{40}' from: '[a-zA-Z0-9]{40}'
generate: expression generate: expression
name: GITHUB_WEBHOOK_SECRET
required: true required: true
- description: A secret string used to configure the Generic webhook. - description: A secret string used to configure the Generic webhook.
displayName: Generic Webhook Secret displayName: Generic Webhook Secret
name: GENERIC_WEBHOOK_SECRET
from: '[a-zA-Z0-9]{40}' from: '[a-zA-Z0-9]{40}'
generate: expression generate: expression
name: GENERIC_WEBHOOK_SECRET
required: true required: true
- description: OpenShift Namespace
displayName: Namespace
name: NAMESPACE
required: true
value: talkdevops-step2
objects: objects:
- apiVersion: v1 - apiVersion: v1
kind: BuildConfig kind: BuildConfig
metadata: metadata:
annotations: annotations:
pipeline.alpha.openshift.io/uses: '[{"name": "${APP_NAME}", "namespace": "", "kind": "DeploymentConfig"}]' pipeline.alpha.openshift.io/uses: '[{"name": "${APP_NAME}", "namespace": "", "kind": "DeploymentConfig"}]'
creationTimestamp: null
labels: labels:
name: ${APP_NAME}-pipeline name: ${APP_NAME}-pipeline
name: ${APP_NAME}-pipeline name: ${APP_NAME}-pipeline
@ -61,13 +62,11 @@ objects:
timeout(time: 20, unit: 'MINUTES') { timeout(time: 20, unit: 'MINUTES') {
def appName="${APP_NAME}" def appName="${APP_NAME}"
def project="" def project=""
node { node {
stage("Initialize") { stage("Initialize") {
project = env.PROJECT_NAME project = env.PROJECT_NAME
} }
} }
node("maven") { node("maven") {
stage("Checkout") { stage("Checkout") {
git url: "${GIT_SOURCE_URL}", branch: "${GIT_SOURCE_REF}" git url: "${GIT_SOURCE_URL}", branch: "${GIT_SOURCE_REF}"
@ -77,7 +76,6 @@ objects:
stash name:"jar", includes:"target/spring-petclinic-1.5.1.jar" stash name:"jar", includes:"target/spring-petclinic-1.5.1.jar"
} }
} }
node { node {
stage("Build Image") { stage("Build Image") {
unstash name:"jar" unstash name:"jar"
@ -115,42 +113,33 @@ objects:
targetPort: 8080 targetPort: 8080
selector: selector:
name: ${APP_NAME} name: ${APP_NAME}
deploymentconfig: ${APP_NAME}
- apiVersion: v1 - apiVersion: v1
kind: Route kind: Route
metadata: metadata:
name: ${APP_NAME} name: ${APP_NAME}
labels:
app: ${APP_NAME}
spec: spec:
host: ${APPLICATION_DOMAIN} port:
targetPort: web
to: to:
kind: Service kind: Service
name: ${APP_NAME} name: ${APP_NAME}
port:
targetPort: web
- apiVersion: v1 - apiVersion: v1
kind: ImageStream kind: ImageStream
metadata: metadata:
annotations: annotations:
description: Docker images hub description: Docker images hub
labels:
app: ${APP_NAME}
name: ${APP_NAME} name: ${APP_NAME}
- apiVersion: v1 - apiVersion: v1
kind: BuildConfig kind: BuildConfig
metadata: metadata:
labels: annotations:
app: ${APP_NAME}-docker description: Define como criar o aplicativo
name: ${APP_NAME}-docker name: ${APP_NAME}-docker
spec: spec:
output: output:
to: to:
kind: ImageStreamTag kind: ImageStreamTag
name: ${APP_NAME}:latest name: ${APP_NAME}:latest
postCommit: {}
resources: {}
runPolicy: Serial
source: source:
dockerfile: |- dockerfile: |-
FROM docker.io/maven:alpine FROM docker.io/maven:alpine
@ -171,14 +160,13 @@ objects:
- apiVersion: v1 - apiVersion: v1
kind: DeploymentConfig kind: DeploymentConfig
metadata: metadata:
labels: annotations:
app: ${APP_NAME} description: Define como é realizada a implantação do APP
name: ${APP_NAME} name: ${APP_NAME}
spec: spec:
replicas: 1 replicas: 1
selector: selector:
app: ${APP_NAME} name: ${APP_NAME}
deploymentconfig: ${APP_NAME}
strategy: strategy:
rollingParams: rollingParams:
intervalSeconds: 1 intervalSeconds: 1
@ -190,8 +178,8 @@ objects:
template: template:
metadata: metadata:
labels: labels:
app: ${APP_NAME} name: ${APP_NAME}
deploymentconfig: ${APP_NAME} name: ${APP_NAME}
spec: spec:
containers: containers:
- image: ${APP_NAME}:latest - image: ${APP_NAME}:latest
@ -200,8 +188,6 @@ objects:
ports: ports:
- containerPort: 8080 - containerPort: 8080
protocol: TCP protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /
@ -210,8 +196,6 @@ objects:
initialDelaySeconds: 10 initialDelaySeconds: 10
timeoutSeconds: 2 timeoutSeconds: 2
periodSeconds: 10 periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe: readinessProbe:
httpGet: httpGet:
path: / path: /
@ -220,21 +204,15 @@ objects:
initialDelaySeconds: 30 initialDelaySeconds: 30
timeoutSeconds: 2 timeoutSeconds: 2
periodSeconds: 10 periodSeconds: 10
successThreshold: 1 triggers:
failureThreshold: 3 - type: ConfigChange
dnsPolicy: ClusterFirst - imageChangeParams:
restartPolicy: Always automatic: true
securityContext: {} containerNames:
terminationGracePeriodSeconds: 30 - ${APP_NAME}
test: false from:
triggers: kind: ImageStreamTag
- type: ConfigChange name: '${APP_NAME}:latest'
- imageChangeParams: namespace: ${NAMESPACE}
automatic: true type: ImageChange
containerNames: - type: ConfigChange
- ${APP_NAME}
from:
kind: ImageStreamTag
name: ${APP_NAME}:latest
type: ImageChange
- type: ConfigChange