apiVersion: template.openshift.io/v1 kind: Template labels: template: coolstore-monolith-pipeline-build message: The resources (build config, deploy config, service, imagestreams, etc) for running the Coolstore Monolith demo has been created in your project. To deploy the application go to your source directoy and build that code using mvn -Popenshift package and then start the build using oc start-build coolstore --from-file=deployments/ROOT.war. metadata: annotations: description: Application template Coolstore Monolith using pipeline build. iconClass: icon-jboss openshift.io/display-name: Coolstore Monolith using pipelines tags: eap,postgresql,javaee,java,database,jboss,xpaas version: 1.0.0 creationTimestamp: "2020-02-08T04:25:45Z" name: coolstore-monolith-pipeline-build namespace: openshift resourceVersion: "42541" selfLink: /apis/template.openshift.io/v1/namespaces/openshift/templates/coolstore-monolith-pipeline-build uid: 87c77677-f7f1-4bed-854e-73ab9150cae9 objects: - apiVersion: v1 kind: ImageStream metadata: labels: application: coolstore name: coolstore - apiVersion: v1 kind: Service metadata: annotations: description: The web server's http port. service.alpha.openshift.io/dependencies: '[{"name":"coolstore-prod-postgresql","namespace":"","kind":"Service"}]' labels: application: coolstore-prod name: coolstore-prod spec: ports: - port: 8080 targetPort: 8080 selector: deploymentConfig: coolstore-prod - apiVersion: v1 kind: Service metadata: annotations: description: The database server's port. labels: application: coolstore-prod name: coolstore-prod-postgresql spec: ports: - port: 5432 targetPort: 5432 selector: deploymentConfig: coolstore-prod-postgresql - apiVersion: v1 kind: Route metadata: annotations: description: Route for application's http service. labels: application: coolstore-prod name: www spec: to: name: coolstore-prod - apiVersion: v1 kind: DeploymentConfig metadata: labels: application: coolstore-prod name: coolstore-prod spec: replicas: 1 selector: deploymentConfig: coolstore-prod strategy: resources: {} type: Recreate template: metadata: labels: application: coolstore-prod deploymentConfig: coolstore-prod name: coolstore-prod spec: containers: - env: - name: DB_SERVICE_PREFIX_MAPPING value: coolstore-prod-postgresql=DB - name: DB_JNDI value: ${DB_JNDI} - name: DB_USERNAME value: ${DB_USERNAME} - name: DB_PASSWORD value: ${DB_PASSWORD} - name: DB_DATABASE value: ${DB_DATABASE} - name: TX_DATABASE_PREFIX_MAPPING value: coolstore-prod-postgresql=DB - name: DB_MIN_POOL_SIZE value: ${DB_MIN_POOL_SIZE} - name: DB_MAX_POOL_SIZE value: ${DB_MAX_POOL_SIZE} - name: DB_TX_ISOLATION value: ${DB_TX_ISOLATION} - name: OPENSHIFT_KUBE_PING_LABELS value: application=coolstore-prod - name: OPENSHIFT_KUBE_PING_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: HTTPS_KEYSTORE_DIR value: /etc/eap-secret-volume - name: HTTPS_KEYSTORE value: keystore.jks - name: HTTPS_KEYSTORE_TYPE value: JKS - name: HTTPS_NAME value: jboss - name: HTTPS_PASSWORD value: mykeystorepass - name: MQ_TOPICS value: orders - name: MQ_CLUSTER_PASSWORD value: ${MQ_CLUSTER_PASSWORD} - name: JGROUPS_ENCRYPT_SECRET value: coolstore-prod-secret - name: JGROUPS_ENCRYPT_KEYSTORE_DIR value: /etc/jgroups-encrypt-secret-volume - name: JGROUPS_ENCRYPT_KEYSTORE value: jgroups.jceks - name: JGROUPS_ENCRYPT_NAME value: secret-key - name: JGROUPS_ENCRYPT_PASSWORD value: password - name: JGROUPS_CLUSTER_PASSWORD value: ${JGROUPS_CLUSTER_PASSWORD} - name: AUTO_DEPLOY_EXPLODED value: ${AUTO_DEPLOY_EXPLODED} - name: DEFAULT_JOB_REPOSITORY value: coolstore-prod-postgresql - name: TIMER_SERVICE_DATA_STORE value: coolstore-prod-postgresql image: coolstore imagePullPolicy: Always lifecycle: preStop: exec: command: - /opt/eap/bin/jboss-cli.sh - -c - :shutdown(timeout=60) readinessProbe: httpGet: path: /health.jsp port: 8080 scheme: HTTP timeoutSeconds: 5 periodSeconds: 30 successThreshold: 1 failureThreshold: 20 initialDelaySeconds: 20 livenessProbe: httpGet: path: /health.jsp port: 8080 scheme: HTTP timeoutSeconds: 5 periodSeconds: 30 successThreshold: 1 failureThreshold: 20 initialDelaySeconds: 20 name: coolstore-prod ports: - containerPort: 8778 name: jolokia protocol: TCP - containerPort: 8080 name: http protocol: TCP - containerPort: 8443 name: https protocol: TCP - containerPort: 8888 name: ping protocol: TCP volumeMounts: - mountPath: /etc/eap-secret-volume name: eap-keystore-volume readOnly: true - mountPath: /etc/jgroups-encrypt-secret-volume name: eap-jgroups-keystore-volume readOnly: true serviceAccountName: coolstore-prod-serviceaccount terminationGracePeriodSeconds: 75 volumes: - name: eap-keystore-volume secret: secretName: coolstore-prod-secret - name: eap-jgroups-keystore-volume secret: secretName: coolstore-prod-secret triggers: - imageChangeParams: automatic: true containerNames: - coolstore-prod from: kind: ImageStreamTag name: coolstore:prod type: ImageChange - type: ConfigChange - apiVersion: v1 kind: DeploymentConfig metadata: labels: application: coolstore-prod name: coolstore-prod-postgresql spec: replicas: 1 selector: deploymentConfig: coolstore-prod-postgresql strategy: type: Recreate template: metadata: labels: application: coolstore-prod deploymentConfig: coolstore-prod-postgresql name: coolstore-prod-postgresql spec: containers: - env: - name: POSTGRESQL_USER value: ${DB_USERNAME} - name: POSTGRESQL_PASSWORD value: ${DB_PASSWORD} - name: POSTGRESQL_DATABASE value: ${DB_DATABASE} - name: POSTGRESQL_MAX_CONNECTIONS value: "100" - name: POSTGRESQL_MAX_PREPARED_TRANSACTIONS value: "100" image: postgresql imagePullPolicy: Always livenessProbe: failureThreshold: 3 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 tcpSocket: port: 5432 timeoutSeconds: 1 name: coolstore-prod-postgresql ports: - containerPort: 5432 protocol: TCP readinessProbe: exec: command: - /bin/sh - -i - -c - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1' failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 terminationGracePeriodSeconds: 60 triggers: - imageChangeParams: automatic: true containerNames: - coolstore-prod-postgresql from: kind: ImageStreamTag name: postgresql:10 namespace: ${IMAGE_STREAM_NAMESPACE} type: ImageChange - type: ConfigChange - apiVersion: v1 kind: BuildConfig metadata: labels: build: monolith-pipeline template: coolstore-monolith-prod-demo name: monolith-pipeline spec: nodeSelector: null output: {} postCommit: {} resources: {} runPolicy: Serial source: type: None strategy: jenkinsPipelineStrategy: jenkinsfile: "pipeline { \n agent {\n label 'maven'\n }\n stages {\n \ stage ('Build') {\n steps {\n sleep 5\n }\n }\n \ stage ('Run Tests in DEV') {\n steps {\n sleep 10\n }\n \ }\n stage ('Deploy to PROD') {\n steps {\n script {\n \ openshift.withCluster() {\n openshift.tag(\"${USER_ID}-coolstore-dev/coolstore:latest\", \"${USER_ID}-coolstore-prod/coolstore:prod\")\n }\n }\n }\n \ }\n stage ('Run Tests in PROD') {\n steps {\n sleep 30\n \ }\n }\n }\n}" type: JenkinsPipeline triggers: - github: secret: ${GITHUB_WEBHOOK_SECRET} type: GitHub - generic: secret: ${GENERIC_WEBHOOK_SECRET} type: Generic status: lastVersion: 0 - apiVersion: v1 kind: ServiceAccount metadata: name: coolstore-prod-serviceaccount secrets: - name: coolstore-prod-secret - apiVersion: v1 groupNames: null kind: RoleBinding metadata: name: coolstore-prod-serviceaccount_view roleRef: name: view subjects: - kind: ServiceAccount name: coolstore-prod-serviceaccount - apiVersion: v1 data: jgroups.jceks: zs7OzgAAAAIAAAABAAAAAwAKc2VjcmV0LWtleQAAAVDQhuHmrO0ABXNyADNjb20uc3VuLmNyeXB0by5wcm92aWRlci5TZWFsZWRPYmplY3RGb3JLZXlQcm90ZWN0b3LNV8pZ5zC7UwIAAHhyABlqYXZheC5jcnlwdG8uU2VhbGVkT2JqZWN0PjY9psO3VHACAARbAA1lbmNvZGVkUGFyYW1zdAACW0JbABBlbmNyeXB0ZWRDb250ZW50cQB+AAJMAAlwYXJhbXNBbGd0ABJMamF2YS9sYW5nL1N0cmluZztMAAdzZWFsQWxncQB+AAN4cHVyAAJbQqzzF/gGCFTgAgAAeHAAAAAPMA0ECHcwLGK6EDyLAgEUdXEAfgAFAAAAmCu9wRKf1aYYUOEWe406ncPtIdm3147G7MJyWUu2k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ru1gNUXYHaE8+iikx9yyc8V8V4CG63qk= kind: Secret metadata: annotations: description: Default HTTPS keystore (keystore.jks) with name 'jboss' and password 'mykeystorepass' and JGoups keystore (jgroups.jceks) with name 'secret-key' and password 'password' name: coolstore-prod-secret parameters: - description: Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/postgresql displayName: Database JNDI Name name: DB_JNDI value: java:jboss/datasources/CoolstoreDS - description: User ID for Dev/Prod namespaces displayName: User ID required: true name: USER_ID - description: Database name displayName: Database Name name: DB_DATABASE required: true value: monolith - description: Sets xa-pool/min-pool-size for the configured datasource. displayName: Datasource Minimum Pool Size name: DB_MIN_POOL_SIZE - description: Sets xa-pool/max-pool-size for the configured datasource. displayName: Datasource Maximum Pool Size name: DB_MAX_POOL_SIZE - description: Sets transaction-isolation for the configured datasource. displayName: Datasource Transaction Isolation name: DB_TX_ISOLATION - description: A-MQ cluster admin password displayName: A-MQ cluster password from: '[a-zA-Z0-9]{8}' generate: expression name: MQ_CLUSTER_PASSWORD required: true - description: Database user name displayName: Database Username from: user[a-zA-Z0-9]{3} generate: expression name: DB_USERNAME required: true - description: Database user password displayName: Database Password from: '[a-zA-Z0-9]{8}' generate: expression name: DB_PASSWORD required: true - description: GitHub trigger secret displayName: Github Webhook Secret from: '[a-zA-Z0-9]{8}' generate: expression name: GITHUB_WEBHOOK_SECRET required: true - description: Generic build trigger secret displayName: Generic Webhook Secret from: '[a-zA-Z0-9]{8}' generate: expression name: GENERIC_WEBHOOK_SECRET required: true - description: Namespace in which the ImageStreams for Red Hat Middleware images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project. displayName: ImageStream Namespace name: IMAGE_STREAM_NAMESPACE required: true value: openshift - description: JGroups cluster password displayName: JGroups Cluster Password from: '[a-zA-Z0-9]{8}' generate: expression name: JGROUPS_CLUSTER_PASSWORD required: true - description: Controls whether exploded deployment content should be automatically deployed displayName: Deploy Exploded Archives name: AUTO_DEPLOY_EXPLODED value: "false"