(Need Help) Installing OpenMRS SDK on Openshift

Hi,

We are trying to install the OpenMRS SDK on our Openshift environment. Can somebody help us with the steps to install the SDK on Openshift.

Thanks

Is this of any help? https://wiki.openmrs.org/display/docs/Installing+OpenMRS+on+OpenShift

Hi @dkayiwa, is it for installing the SDK or Platform? Please confirm. Thanks

Hi @dkayiwa, could you please confirm if we can use this https://wiki.openmrs.org/display/docs/Installing+OpenMRS+on+OpenShift to install SDK on Openshift.

Thanks

Did you try it out?

No. I did not try. Waiting for the confirmation.

Hi @dkayiwa, our Organization is not supporting DIY Catridge (As suggested in: https://wiki.openmrs.org/display/docs/Installing+OpenMRS+on+OpenShift). So could you please suggest me a different approach. And also this document refers the platform 1.x (Correct me If I’m wrong), but we are looking for latest version. Thanks

Can somebody help me on this?

Based on https://om.rs/sdk, this Dockerfile should give you a dockerized OpenMRS SDK:

Dockerfile
FROM maven

RUN yes | mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk

The yes in the run command will answer “y” to the one SDK prompt

"Would you be willing to help us improve SDK by sending us once in a while anonymous usage statistics (you can always change your mind by going to sdk-stats.properties and setting statsEnabled to false) [Y/n]:

If you don’t want to help improve the SDK, then you could replace yes with echo "n".

Using the above Dockerfile:

$ docker build -t sdk .
$ docker run --rm -it sdk bash
# mvn openmrs-sdk:help
OpenMRS SDK 3.13.2

Of course, you’d probably want to embellish the Dockerfile a bit with ports, volumes, etc.

Here’s an example of using the sdk Docker image we created to start development of a Reference Application module:

$ docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=secret mysql:5.6
$ docker run --rm -it -p 8888:8080 --link mysql:db \
    sdk mvn openmrs-sdk:setup && mvn openmrs-sdk:create-project

Specify server id (-DserverId) (default: 'server'): 

You can setup the following servers:
1) Distribution
2) Platform

Which one do you choose? [1/2]: 1

You can deploy the following versions of distribution:
1) Reference Application 2.9.0-SNAPSHOT
2) Reference Application 2.8.1
3) Reference Application 2.7.0
4) Reference Application 2.6.1
5) Reference Application 2.5
6) Other...

Which one do you choose? [1/2/3/4/5/6]: 2

What port would you like your server to use? (default: '8080'): 

If you want to enable remote debugging by default when running the server, 
specify the port number here (e.g. 1044). Leave blank to disable debugging. 
(Do not do this on a production server) (default: 'no debugging'): 

Which database would you like to use?:
1) MySQL 5.6 (requires pre-installed MySQL 5.6)
2) MySQL 5.6 in SDK docker container (requires pre-installed Docker)
3) Existing docker container (requires pre-installed Docker)

Which one do you choose? [1/2/3]: 1

The distribution requires MySQL database. Please specify database uri (-DdbUri) (default: 'jdbc:mysql://localhost:3306/@DBNAME@'): jdbc:mysql://db:3306/@DBNAME@

Please specify database username (-DdbUser) (default: 'root'): 
Please specify database password (-DdbPassword) (default: ' '): <secret>

Connected to the database.

Importing an initial database from classpath://openmrs-platform.sql...

Database imported successfully.

The search index has been reset.

Note: JDK 1.8 is needed for platform version 2.1.3.

Which JDK would you like to use to run this server?:
1) JAVA_HOME (currently: /usr/lib/jvm/java-8-openjdk-amd64/jre)
2) Other...

Which one do you choose? [1/2]: 1

[INFO] Server configured successfully, path: /root/openmrs/server
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:04 min
[INFO] Finished at: 2019-01-08T06:18:39Z
[INFO] ------------------------------------------------------------------------

What kind of project would you like to create?:
1) Platform module
2) Reference Application module
3) Open Web App

Which one do you choose? [1/2/3]: 2

Module id uniquely identifies your module in the OpenMRS world.

It is advised to consult your module id on https://talk.openmrs.org 
to eliminate possible collisions. 

Module id must consists of lowercase letters, must start from 
a letter, can contain alphanumerics and dots, e.g. webservices.rest, 
metadatasharing, reporting, htmlformentry.

Please specify module id (default: 'basicexample'): 

Module name is a user friendly name displayed to the user 
instead of the module id. 

By convention it is a module id with spaces between words.

Please specify module name (default: 'Basicexample'): 

Describe your module in a few sentences (default: 'no description'): 

GroupId, artifactId and version combined together identify 
your module in the maven repository. 

By convention OpenMRS modules use 'org.openmrs.module' as a groupId 
(must follow convention for naming java packages) and the module id 
as an artifactId. The version should follow maven versioning convention, 
which in short is: major.minor.maintenance(-SNAPSHOT).

Please specify groupId (default: 'org.openmrs.module'): 

Please specify initial version (default: '1.0.0-SNAPSHOT'): 

What is the lowest version of the Reference Application (-Drefapp) you want to support? (default: '2.4'): 

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.030 s
[INFO] Finished at: 2019-01-08T01:19:07-05:00
[INFO] ------------------------------------------------------------------------

$ ls -l basicexample/
total 8
drwxr-xr-x  4 bmamlin  staff   128 Jan  8 01:19 api
drwxr-xr-x  4 bmamlin  staff   128 Jan  8 01:19 omod
-rw-r--r--  1 bmamlin  staff  2204 Jan  8 01:19 pom.xml 
1 Like

Thank you so much @burke! Let me try the above mentioned steps.