IBM Maximo: Maximo Manage development environment without OpenShift

From Wiki

Pull image from IBM Repository

Go to this webpage to get your entitlement key: https://myibm.ibm.com/products-services/containerlibrary

Set the IBM Entitlement Registry Key

export ENTITLED_REGISTRY_KEY=eyJ...

Do a login to Podman

podman login cp.icr.io -u cp -p $ENTITLED_REGISTRY_KEY


List Available Tags for a Manage Admin with skopeo tool.

skopeo list-tags docker://cp.icr.io/cp/manage/manageadmin


Inspect a Manage Admin Image

skopeo inspect docker://cp.icr.io/cp/manage/manageadmin:9.0.0


Pull a Manage Admin Image

podman pull cp.icr.io/cp/manage/manageadmin:9.0.0

Run Manage Admin

Run container in background

podman run -d cp.icr.io/cp/manage/manageadmin:9.0.0

Check status

podman ps

The output is

CONTAINER ID  IMAGE                                  COMMAND     CREATED        STATUS        PORTS       NAMES
40e118bf9318  cp.icr.io/cp/manage/manageadmin:9.0.0              3 seconds ago  Up 3 seconds              pedantic_cerf

Connect to container and you can check current directory

podman exec -it 40e118bf9318 sh

sh-4.5$ pwd

Update the properties in the

/opt/IBM/SMP/maximo/applications/maximo/properties/maximo.properties

file with the URL, user name, and password for your Maximo Manage database.

Customization

Customization Guidelines

Your source code must have the same directory structure used by Maximo. Sample:

applications\maximo\businessobjects\classes\cust\app\asset\Asset.class
applications\maximo\businessobjects\classes\cust\app\asset\AssetSet.class
applications\maximo\properties\product\a_customer.xml
tools\maximo\en\cust\V7612_01.dbc
applications\maximo\commonweb\classes\com\ibm\tivoli\maximo\oslc\provider\MyPingServlet.class
deployment\was-liberty-default\config-deployment-descriptors\maximo-all\meaweb\webmodule\WEB-INF\web.xml

For server bundles with a bundle type of mea, ui, cron, report. You can use:

deployment\was-liberty-default\config-deployment-descriptors\maximo-mea\meaweb\webmodule\WEB-INF\web.xml
deployment\was-liberty-default\config-deployment-descriptors\maximo-ui\webmodule\WEB-INF\web.xml

Copy files to container

Get your source code, create a zip file and copy to container

podman cp mycode.zip  40e118bf9318:/home/maximoinstall/mycode.zip

Access your Maximo Manager container

podman exec -it 40e118bf9318 sh

Prepare environment

cd /home/maximoinstall

mkdir src target

cd src

unzip mycode.zip

Compile Java customization and create customization_binaries.zip

Inside the container, let's export environment variables

export JAVA_HOME=/opt/ibm/java
export LIB_DIR=/opt/IBM/SMP/maximo/applications/maximo/lib/*
export CLASS_DIR=/opt/IBM/SMP/maximo/applications/maximo/businessobjects/classes/*

add the list of java files to sources.txt file

cd /home/maximoinstall/src

find . -name "*.java" > sources.txt

Compile files

$JAVA_HOME/bin/javac -d target -cp "$LIB_DIR:$CLASS_DIR" @sources.txt

Confirm that you dont have errors

Copy Non-Java Files using rsync

rsync -av --exclude="*.java" src/ target/

If you dont have rsync try this:

find src/ -type f ! -name "*.java" -exec cp --parents \{\} target/ \;


Create customization archive

cd /home/maximoinstall/target 

zip --verbose -r ../customization_binaries.zip *

Provide you customization_binaries.zip on OpenShift

Start by creating a new project:

oc new-project nginx-custom-binaries

Create

oc new-app --template=openshift/nginx-example --name=nginx-custom 

Check pod

oc get pods

Look for the pod name that starts with nginx-custom-. You’ll need this for the next step.

Upload custominization_binaries.zip

oc cp customization_binaries.zip <pod-name>:/usr/share/nginx/html/customization_binaries.zip

Check the Route to Access Your App

oc get routes

This will show the external URL where your custom NGINX content is being served.

http://xxxxxx/custominization_binaries.zip

How to test

  • Extract the content in the same directory structure as customization archive
  • Deploy customization archive on a test environment , or
  • Test customization archive use local container deployment for Manage without OpenShift and MAS for limited but fast testing

Articles

Ver também