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


You can deploy the Employee Rostering starter application to Red Hat OpenShift Container Platform using an OpenShift template or using the provision.sh shell script that is provided in the reference implementation distribution.

If you use an OpenShift template, Red Hat OpenShift Container Platform loads an image with the application from the Red Hat repository and deploys it. This method of deployment is a technological preview.

If you use the script, it builds and packages the application source code locally and uploads it to the OpenShift environment for deployment. You can use this method when Java developer tools (Java Development Kit and Maven) and a bash shell command line are available.

19.1. Deploying the application using the provided script

You can deploy the Employee Rostering starter application to Red Hat OpenShift Container Platform using the provided script. The script builds and packages the application source code locally and uploads it to the OpenShift environment for deployment.

Prerequisites

  • You are logged in to the target OpenShift environment using the oc command line tool. For more information about this tool, see CLI Reference.
  • Maven and a Java Development Kit are installed on your local system.
  • A bash shell environment is available on your local system.

Procedure

  1. Download the rhpam-7.9.1-maven-repository.zip file from the Software Downloads page of the Red Hat Customer Portal.
  2. Expand the downloaded archive.
  3. Copy the contents of the jboss-rhba-7.9.1.GA-maven-repository/maven-repository subdirectory into the ~/.m2/repository directory.
  4. Download the rhpam-7.9.1-reference-implementation.zip file from the Software Downloads page of the Red Hat Customer Portal.
  5. Expand the downloaded archive.
  6. Unzip the rhpam-7.9.1-optaweb-employee-rostering.zip file that is extracted from the reference implementation archive.
  7. Using the command line, change to the optaweb-employee-rostering-distribution-7.44.0.Final-redhat-00006/sources folder.
  8. To build the Employee Rostering application, run the following command:

    mvn clean install -DskipTests -DskipITs
  9. Log in to an OpenShift account or a Red Hat Code Ready Container instance. In the following example, <account-url> is the URL for an OpenShift account or Red Hat Code Ready Container instance and <login-token> is the login token for that account:

    oc login <account-url> --token <login-token>
  10. Create a new project to host Employee Rostering:

    oc new-project optaweb-employee-rostering
  11. Run the provision script to build and deploy the application:

    ./provision.sh

    Compilation and packaging might take up to 10 minutes to complete. These processes continually show progress on the command line output.

    When the operation completes, the following message is displayed, where <URL> is the URL for the deployment:

    You can access the application at <URL> once the deployment is done.
  12. Enter the URL that you used earlier in the procedure, for either an OpenShift account or Red Hat Code Ready Container instance, to access the deployed application. The first startup can take up to a minute because additional building is completed on the OpenShift platform.

    Note

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

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.