Este conteúdo não está disponível no idioma selecionado.

Chapter 1. Installing and running the employee rostering demonstration on OpenShift


You can deploy the Red Hat Business Optimizer Employee Rostering starter application to an OpenShift instance.

Preparing deployment files

  1. Unzip the add-ons distribution (rhpam-7.0.0-add-ons.zip).
  2. Unzip the employee rostering zip file (rhpam-7.0-employee-rostering.zip) that is extracted from the add-ons archive.

    Note

    When you unzip the employee rostering zip file, the optashift-employee-rostering-7.7.0.Final-redhat-7 folder is created. This folder is the base folder in subsequent steps. File and folder names may have higher version numbers than specifically noted in this document.

There are two options for quickly deploying this application to OpenShift:

  1. Using the provision.sh shell script that is provided in the add-ons distribution. In this case, 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.
  2. Using the provided Source to Image (S2I) template. This template pulls the source for the application from a Git repository and builds it during the deployment. In this case, the compilation and packaging of the application occurs within the OpenShift environment. Use this option when the prerequisites for using provision.sh are not available.
Note

The S2I approach requires significantly more OpenShift resources to complete than the shell script deployment. If your OpenShift environment has less than 2GB of memory available, you must follow the shell script deployment approach. The application will not deploy successfully with any method to the OpenShift Online Starter tier at the time of this writing because of memory requirements.

1.1. Deploying using the provided script

Prerequisite

  • You have logged in to the target OpenShift environment using the oc command line tool.

Procedure

  1. Running the script

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

      ./provision.sh setup employee-rostering --binary
      Copy to Clipboard Toggle word wrap
      Note

      If the current OpenShift user name contains characters that are not letters or numbers, the deployment might fail. This can be fixed by providing an additional parameter: ./provision.sh setup employee-rostering --binary --project-suffix optashift. This example uses "optashift", but the actual value has no impact on the deployment.

  2. Verify the compilation status

    1. Compilation and packaging may take several minutes to complete, and should continually show progress on the command line output.
    2. Once 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 build can take up to 30 seconds to complete. The application container can take an additional 30 seconds to start up completely.

    Note

    Perform a hard refresh of your browser page if the web app does not open after clicking the link.

    Figure 1.1. OpenShift web console with deployed Employee Rostering starter application

  4. 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
    2. Remove the application: ./provision.sh delete employee-rostering

1.2. Deploying using the Source to Image (S2I) template

Procedure

  1. Log in to the OpenShift web console and click Import YAML/JSON in the upper right corner.
  2. Select the project to add to from the Add to Project drop down menu, or select Create Project to create a new one. If creating a new project, enter a new project name, display name, and description.
  3. Click the Browse button and navigate to the optashift-employee-rostering-template.yaml file. Starting from the optashift-employee-rostering-7.7.0.Final-redhat-7 folder, access the file by clicking sources > openshift > templates.
  4. Click Create.

    Figure 1.2. Upload template window

  5. In the Add Template dialog box, click Continue to accept the default settings.

    Figure 1.3. Add template window

  6. In the Import YAML/JSON dialog box, click Create to accept the default settings.

    Figure 1.4. Configure template window

  7. In the Success dialog box, click Close.
  8. Wait for the build and deployment to complete. This might take several minutes. When the deployment completes, click the link in the upper right corner above the shaded bar to open the application.

    Figure 1.5. Completed deployment and resulting link

    Note

    Perform a hard refresh of your browser page if the web app does not open after clicking the link.

Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat