Ce contenu n'est pas disponible dans la langue sélectionnée.
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.
The runOnOpenShift.sh script builds and packages the application source code locally and uploads it to the OpenShift environment for deployment. This method requires Java Development Kit, Apache Maven, and a bash shell command line.
19.1. Deploying the application using the provided script Copier lienLien copié sur presse-papiers!
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
occommand line tool. For more information about this tool, see CLI Reference. - Maven and a Java Development Kit are installed on your local system.
-
A
bashshell environment is available on your local system.
Procedure
-
Download the
rhdm-7.10.0-maven-repository.zipfile from the Software Downloads page of the Red Hat Customer Portal. - Expand the downloaded archive.
-
Copy the contents of the
jboss-rhba-7.10.0.GA-maven-repository/maven-repositorysubdirectory into the~/.m2/repositorydirectory. -
Download the
rhdm-7.10.0-reference-implementation.zipfile from the Software Downloads page of the Red Hat Customer Portal. - Expand the downloaded archive.
-
Unzip the
rhdm-7.10.0-optaweb-employee-rostering.zipfile that is extracted from the reference implementation archive. -
Using the command line, change to the
optaweb-employee-rostering-distribution-7.48.0.Final-redhat-00004/sourcesfolder. To build the Employee Rostering application, run the following command:
mvn clean install -DskipTests -DskipITs
mvn clean install -DskipTests -DskipITsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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>
oc login <account-url> --token <login-token>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a new project to host Employee Rostering:
oc new-project optaweb-employee-rostering
oc new-project optaweb-employee-rosteringCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the provision script to build and deploy the application:
./provision.sh
./provision.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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.
You can access the application at <URL> once the deployment is done.Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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.
NoteIf the application does not open a minute after clicking the link, perform a hard refresh of your browser page.