Chapter 2. Installing and starting the employee rostering starter application on OpenShift

You can deploy the Red Hat Business Optimizer Employee Rostering starter application to Red Hat OpenShift Container Platform using the provision.sh shell script that is provided in the add-ons distribution.

The application source code is built and packaged locally and uploaded to the OpenShift environment for deployment. Use this preferred method when Java developer tools (Java Development Kit and Maven) and a bash shell command line are available.

Important

The data is held in memory and lost when the pod is restarted.

2.1. Preparing deployment files

You must download and prepare the deployment files before building and deploying the application.

Procedure

  1. Download the rhpam-7.1.0-add-ons.zip file from the Software Downloads page for Red Hat Process Automation Manager 7.1.
  2. Unzip the downloaded archive.
  3. Unzip the employee rostering zip file (rhpam-7.1.0-employee-rostering.zip) that is extracted from the add-ons archive.

Result

When you unzip the employee rostering zip file, the optashift-employee-rostering-7.11.0.Final-redhat-00002 folder is created. This folder is the base folder in subsequent steps.

Note

File and folder names might have higher version numbers than specifically noted in this document.

2.2. Deploying the application using the provided script

Prerequisites

  • You must be logged in to the target OpenShift environment using the oc command line tool. For more information about this tool, see CLI Reference.

    1. Java Development Kit and Maven must be installed on your local machine.
    2. A bash shell environment must be available on your local machine.

Procedure

  1. Using the command line, change to the optashift-employee-rostering-7.11.0.Final-redhat-00002/sources folder.
  2. Run the provision script to build and deploy the application:

    ./provision.sh setup employee-rostering --binary
    Note

    If the current OpenShift user name contains characters that are not letters or numbers, the deployment might fail. You can resolve this issue by providing an additional parameter: ./provision.sh setup employee-rostering --binary --project-suffix optaweb. This example uses "optaweb", but you can use any value for the suffix.

    Compilation and packaging might take several minutes to complete. They continually show progress on the command line output.

    When the operation is completed, the following message is displayed: Uploading file "target/ROOT.war" as binary input for the build …​.

  3. Use the OpenShift web UI to view the details for the deployed application. Click the link in the Routes section to open the starter application. The first startup can take up to a minute as additional building is completed on the OpenShift platform.

If the application does not open for more than a minute after clicking the link, perform a hard refresh of your browser page.

  1. Optionally, you can use other actions provided by the provision script:

    1. Deploy updates to the code to an existing deployment:
./provision.sh deploy employee-rostering --binary

+ .. Remove the application:

./provision.sh delete employee-rostering