kiescanner unable to refresh rules within docker container

88 Views Asked by At

I am unable to refresh rules with latest KJAR using kiescanner. We have Artifactory as remote repository. I have provided custom settings.xml . kie-cie is in pom.xml. In docker I am providing M2-HOME.

Dockerfile ENV APP_HOME =/app ENV MAVEN_HOME /usr/share/maven ENV MAVEN_CONFIG "$APP_HOME/.m2" ENV M2_HOME /usr/share/maven COPY settings.xml /app/.m2/settings.xml COPY settings.xml ${M2_HOME}/conf/settings.xml

My settings.xml has artifactory url. When docker container spins up then it picks latest KJAR release from artifactory. However when I publish new version, it doesn't automatically update within the docker container. Can anyone help? Thanks.

My settings.xml has artifactory url. When docker container spins up then it picks latest KJAR release from artifactory. However when I publish new version, it doesn't automatically update within the docker container. Can anyone help? Thanks.

1

There are 1 best solutions below

2
tarilabs On

The fact that:

When docker container spins up then it picks latest KJAR release from artifactory.

Is a good sign, so that confirms the docker container can see the expected version from the external remote maven repository.

Could it be you missed to set the kieScanner to start with:

// Start the KieScanner polling the Maven repository every 10 seconds
kScanner.start( 10000L );

To have a reproducible behavior I would advise you implement a routing/feature where you can invoke the scan manually with:

kScanner.scanNow();

That way, you can observe the KieScanner results by your explicit invocation, and logs.

Don't forget it is ideal to set a version range, rather than relying on legacy LATEST or RELEASE (see in particular the manual here).

In summary:

  1. Check KieScanner is actually started
  2. Consider feature to invoke KieScanner manually for reproducible and better observable behaviour
  3. Use version ranges, avoid using LATEST or RELEASE for the scan coordinates as explained in the manual

Reference: https://docs.drools.org/8.35.0.Final/drools-docs/docs-website/drools/KIE/index.html#_kiescanner