Skip to content

Commit da181b5

Browse files
Merge pull request #20 from OpenLMIS/1.6.1-SNAPSHOT
Stabilize consul registration and health checks
2 parents f7fa25f + ad0963c commit da181b5

File tree

13 files changed

+2126
-747
lines changed

13 files changed

+2126
-747
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Upcoming Version / (WIP)
22
==================
33

4+
Improvements:
5+
* Stabilized consul registration and health checks
6+
47
1.5.0 / 2025-11-27
58
==================
69

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
FROM openlmis/service-base:7
22

33
COPY build/libs/*.jar /service.jar
4+
45
COPY build/consul /consul
6+
WORKDIR /consul
7+
8+
RUN npm install --production
9+
10+
WORKDIR /
11+

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ check {
8686
assemble {
8787
dependsOn ramlToHtml
8888
dependsOn copyRamlHtmlToBuild
89-
dependsOn copyConsulRegistrationToBuild
89+
dependsOn prepareConsulBuild
9090
dependsOn jacocoTestReport
9191
}
9292

9393
build {
9494
dependsOn check
9595
dependsOn ramlToHtml
9696
dependsOn copyRamlHtmlToBuild
97-
dependsOn copyConsulRegistrationToBuild
97+
dependsOn prepareConsulBuild
9898
dependsOn jacocoTestReport
9999
}

consul/config.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
22
"service": {
33
"Name": "report",
4+
"Id": "report-service",
45
"Port": 8080,
5-
"Tags": ["openlmis-service"]
6+
"Tags": ["openlmis-service"],
7+
"check": {
8+
"interval": "10s",
9+
"http": "http://HOST:PORT/actuator/health",
10+
"timeout": "5s",
11+
"deregisterCriticalServiceAfter": "10m"
12+
}
613
},
7-
"raml": "src/main/resources/api-definition.yaml",
14+
"raml": "/consul/api-definition.yaml",
815
"path": [
916
"report",
1017
"report/docs",

consul/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "openlmis-consul-registration",
3-
"version": "0.0.1",
4-
5-
"devDependencies":
6-
{
7-
"uuid": "~3.0.0",
8-
"raml-parser": "~0.8.0",
9-
"command-line-args": "~3.0.0",
10-
"system-sleep": "~1.0.0",
11-
"deasync": "~0.1.9",
12-
"ip": "~1.1.0"
3+
"version": "1.0.0",
4+
"description": "Registration script for OpenLMIS Service",
5+
"main": "registration.js",
6+
"dependencies": {
7+
"axios": "^1.6.0",
8+
"command-line-args": "^5.2.1",
9+
"ip": "^1.1.8",
10+
"raml-parser": "~0.8.18",
11+
"uuid": "^9.0.0"
12+
},
13+
"engines": {
14+
"node": ">=18"
1315
}
14-
}
16+
}

0 commit comments

Comments
 (0)