Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As an open source low code platform to visually build enterprise web apps for coders and non-coders, Joget Workflow is is a good complement for Cloud Foundry.

Deploy Joget

...

on Pivotal Cloud Foundry

In this example, we will deploy Joget Workflow on PCF Dev from Pivotal. PCF Dev is a lightweight, easy to install distribution of Cloud Foundry designed to run on a developer machine, making it easier to locally develop, test and explore Cloud Foundry.


Step 1: Install PCF Dev

Install PCF Dev according to the instructions in the Pivotal Documentation.

...

Code Block
API endpoint: https://api.local.pcfdev.io

Email> admin 

Password>

Authenticating...

OK

Select an org (or press enter to skip):

1. pcfdev-org

2. system

Org> 1

Targeted org pcfdev-org

Targeted space pcfdev-space


Step 2: Create MySQL Database Service

In Cloud Foundry, all external dependencies such as databases, file systems and so on are considered services. Cloud Foundry allows administrators to provide a marketplace of services, from which users can provision reserved resources on-demand.

...

More detailed information can be found at https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry-dev/connect-a-database 


Step 3: Create Local Volume Service

In Cloud Foundry, a volume service provides a reliable, persistent file system.

...

More detailed information can be found at https://docs.cloudfoundry.org/devguide/services/using-vol-services.html and  https://github.com/cloudfoundry/local-volume-release


Step 4: Download and Deploy Joget

...

WAR

Download Joget Workflow from https://www.joget.org/download/ 

Install Joget Workflow  https://dev.joget.org/community/display/KBv6/Installing+Joget 

Look for the Joget Workflow WAR file jw.war in joget_installation_directory/apache-tomcat/webapps.

...

Note that we use the --no-start parameter to delay the start of the application, because we need to set a couple of environment variables before starting up.


Step 5: Configure and Start

...

Joget 

Set the Apache Tomcat context path to /jw:

...

Next, disable the Spring auto reconfiguration. This is because the Joget Workflow WAR already performs the necessary initialization at startup, and the auto configuration will interfere with it:

...

Start the Joget application:

Code Block
cf start joget


Step 6: Setup Joget

...

Database

Now that the Joget Workflow platform has been deployed in Cloud Foundry, the final step is to setup the database schema, based on https://docs.cloudfoundry.org/devguide/services/migrate-db.html#single-migration.

Info

If you are using Joget Workflow prior to version 6.0.3, you need to modify the default Joget Workflow SQL setup script due to a limitation in MySQL for PCF where explicit locking is not supported i.e. LOCK TABLES.

SSH into the application:

Code Block
cf ssh joget

And download the modified script:

Code Block
curl https://raw.githubusercontent.com/jogetworkflow/jw-community/6.0.3/wflow-consoleweb/src/main/resources/setup/sql/jwdb-mysql.sql > ~/app/WEB-INF/classes/setup/sql/jwdb-mysql.sql 
exit

...

Code Block
System-Provided:
{
"VCAP_SERVICES": {
 "local-volume": [
  {
   "credentials": {},
   "label": "local-volume",
   "name": "jogetdata",
   "plan": "free-local-disk",
   "provider": null,
   "syslog_drain_url": null,
   "tags": [
    "local"
   ],
   "volume_mounts": [
    {
     "container_dir": "/home/vcap/wflow",
     "device_type": "shared",
     "mode": "rw"
    }
   ]
  }
 ],
 "p-mysql": [
  {
   "credentials": {
    "hostname": "mysql-broker.local.pcfdev.io",
    "jdbcUrl": "jdbc:mysql://mysql-broker.local.pcfdev.io:3306/cf_d13b2f40_c124_4c4b_a900_2269e10a7052?user=XMpalSAOEYcClZl2\u0026password=uSRs0B1D6NPNuLOe",
    "name": "cf_d13b2f40_c124_4c4b_a900_2269e10a7052",
    "password": "uSRs0B1D6NPNuLOe",
    "port": 3306,
    "uri": "mysql://XMpalSAOEYcClZl2:uSRs0B1D6NPNuLOe@mysql-broker.local.pcfdev.io:3306/cf_d13b2f40_c124_4c4b_a900_2269e10a7052?reconnect=true",
    "username": "XMpalSAOEYcClZl2"
   },
   "label": "p-mysql",
   "name": "jogetdb",
   "plan": "1gb",
   "provider": null,
   "syslog_drain_url": null,
   "tags": [
    "mysql"
   ],
   "volume_mounts": []
  }
 ]
}
}
{
"VCAP_APPLICATION": {
 "application_id": "a450291a-0440-4727-ba78-c65f12d99961",
 "application_name": "joget",
 "application_uris": [
  "joget.local.pcfdev.io"
 ],
 "application_version": "aedb8053-7288-4272-bcf7-85eab3dbd360",
 "cf_api": "http://api.local.pcfdev.io",
 "limits": {
  "disk": 512,
  "fds": 16384,
  "mem": 1024
 },
 "name": "joget",
 "space_id": "4376eb82-3935-49c1-b543-8df589392831",
 "space_name": "pcfdev-space",
 "uris": [
  "joget.local.pcfdev.io"
 ],
 "users": null,
 "version": "aedb8053-7288-4272-bcf7-85eab3dbd360"
}
}

User-Provided:
JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: [enabled: false]
JBP_CONFIG_TOMCAT: {tomcat: {context_path: "/jw"}}


Access Joget Workflow at
http://joget.local.pcfdev.io/jw/ and you will be presented with the database setup page.

...

Once setup is complete, you will be brought to the Joget Workflow App Center.


Appendix A: Application Manifest File

Optionally, an application manifest file can be used to specify environment variables and bind services.

...

Code Block
cf bind-service joget jogetdata -c '{"mount":"/home/vcap/wflow"}'
cf restage joget


Appendix B: Useful Cloud Foundry Commands

View application logs:

Code Block
cf logs joget

...