Skip to content

ceverke/crm-reference

 
 

Repository files navigation

CRM Demo for Fuse 7.2 on Karaf

This project shows how to develop an application using Red Hat Fuse on Karaf. Both OpenShift based and standard deployments are supported. This project shows how to build applications with database access using the integrated postgreSQL database of the OpenShift platform.

Preparations for minishift deployments

Installation of minishift

First install MiniShift on your computer for your platform

  • Start minishift with the following parameters

    minishift profile set redhatfuse
    minishift config set memory 8GB
    minishift config set cpus 4
    minishift config set image-caching true
    minishift config set disk-size 50g
    minishift start
    
  • You can stop and start minishift Installation:

    minishift stop
    
    minishift start
    

Installation of the OpenShift Red Hat Fuse templates

It is required to install the current Red Hat Fuse templates first

  • Login as system admin and create the Red Hat Fuse 7.2 templates

    oc login -u system:admin
    BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.fuse-720018-redhat-00001
    oc create -n openshift -f ${BASEURL}/fis-image-streams.json
    oc create -n openshift -f https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.fuse-720018-redhat-00001/fis-console-namespace-template.json
    oc create -n openshift -f ${BASEURL}/fuse-apicurito.yml

Instalation of the PostgreSQL database

The postgresql database is used by the crm demo application to persist the data for both the standalone and OpenShift version. To install the database the following steps are required:

  • Start the postgresql database by applying the postgesql tempate provided by OpenShift

    oc new-app postgresql-persistent -p POSTGRESQL_USER=admin -p POSTGRESQL_PASSWORD=admin
  • Open the postgresql service port to connect to from outside minishift

    • First get thename of the created postgresql pod by typing

      oc get pods
    • Now create a port forward by typing

      oc port-forward [name of postgesql pod] 5432:5432
  • Connect to the postgresql using a postgresql client (PGAdmin)

    • Host: localhost, User: admin, Password: admin, database: sampledb
  • Run the following database script to create the database

Installation of the Red Hat Fuse management console

  • Optional with the following step the Red Hat Fuse console can be installed.

    oc new-app fuse70-console

Running the crm application on Karaf Standalone

  • Build the application using maven (project root)

    mvn clean install
  • Download and start Red Hat Fuse 7.2

  • On the Fuse console install the features (be aware that postgesql must be running)

    features:addurl mvn:ch.adesso/crm-features/1.0.0-SNAPSHOT/xml/features 
    features:install crm-standalone

Running the crm application on OpenShift manually

  • Be aware that the fuse templates for openshift must be installed

  • Build the application using maven (project root)

    mvn clean install
  • Deploy the application (project crm-os-starter)

    cd crm-os-starter
    mvn clean fabric8:deploy
  • To undeploy the application:

    mvn clean fabric8:undeploy

Automate the deployment using the Jenkins pipelines

You can add Jenkins to openshift to build and deploy the project with jenkins

  • To add jenkins use the following command

    oc new-app -e JENKINS_PASSWORD=admin openshift/jenkins-2-centos7
  • Create a route to access jenkins

    You can login into jenkins with admin/admin

To support the fabric8 deploy add the admin role to myproject

oc adm policy add-role-to-user admin system:serviceaccount:myproject:default

Experimental

Create a volume

minishift ssh -> Windows putty [email protected] Password: tcuser
sudo -i
mkdir /opt/certs
chmod 777 /opt/certs

Create pv und pvc (certs)

oc login -u systemå:admin
oc project myproject
oc create -f certspv.yaml
oc create -f certspvc.yaml

Copy profiles to the cert-volume

scp *.jks [email protected]:/opt/certs -> Windows pscp
Password: tcuser

Handling of templates

oc get templates
oc process --parameters -n openshift fuse72-console

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%