Workaround for stockmanagement quickstart

Gradle-6.0 is needed to run this in both IntelliJ projects
If we encounter node-js error after docker-compose -f docker-compose.builder.yml run builder, we should rollback package-lock.json and rerun this command

 

Due to not working integration tests in stockmanagement, we can use temporary workaround to run this repository:

Clone openlmis-stockmanagement and openlmis-ref-distro
git clone git@github.com:OpenLMIS/openlmis-stockmanagement.git
git clone git@github.com:OpenLMIS/openlmis-ref-distro.git

We put .env variable to both repos (in refdistro it should be called settings.env). BASE_URL, VIRTUAL_HOST AND PUBLIC_URL inside should be populated with your computer IP adress.


stockmanagement
curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env

ref-distro
cp settings-sample.env settings.env

 

We erase everything connected with integration tests from build.gradle, example script with erased data below.

Inside build.sh in stockmanagement, we replace last line with gradle clean build

In ref-distro, inside .env script we replace original stockmanagement version with OL_STOCKMANAGEMENT_VERSION=latest
This will pull the latest docker container from our pc after we make some changes

(Right now, we just need three commands to create docker image that will be pulled by ref-distro)

Stockmanagement:
docker-compose -f docker-compose.builder.yml run builder
Type in token
docker-compose -f docker-compose.builder.yml build image

Ref-distro:

Run start-local.sh and interrupt it’s run after logs starts falling down. Then type:
docker-compose up -d

 

Debugger:

To attach debugger to stockmanagement you need to:

  • go to ref-distro/docker-compose and at the end of stockmanagement container you want to listen to and specify port it will run on (in this case stockmanagement on port 1144)
    ports:
    - "1144:1144"

  • add this command line arguments:
    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:1144
    to the environment.JAVA_OPTS property

  • in the upper right corner inside IntelliJ (or in the Run from the navbar) press Edit Configurations
    Add new configuration: Remote JVM Debug
    Set host for your IP adress and port you specified in paragraph 1

OpenLMIS: the global initiative for powerful LMIS software