Skip to content

Commit 8aefd53

Browse files
Merge pull request #3 from OpenLMIS/1.2.1-SNAPSHOT
Stabilize consul registration and health checks
2 parents 5506717 + 4fd8061 commit 8aefd53

13 files changed

Lines changed: 275 additions & 353 deletions

File tree

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.1.0 / 2025-11-27
58
==================
69

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@ FROM openlmis/service-base:7
33
COPY build/libs/*.jar /service.jar
44
COPY src/main/resources/db/demo-data/*.csv /demo-data/
55
COPY build/schema /schema
6+
67
COPY build/consul /consul
8+
WORKDIR /consul
9+
10+
RUN npm install --production
11+
12+
WORKDIR /

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ apply from: "registration.gradle"
419419

420420
assemble {
421421
dependsOn npm_run_runApiHtmlConverter
422-
dependsOn copyConsulRegistrationToBuild
422+
dependsOn prepareConsulBuild
423423
dependsOn jacocoTestReport
424424
}
425425

consul/config.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
22
"service": {
33
"Name": "dhis2",
4+
"Id": "dhis2-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
"dhis2",
1017
"dhis2/docs",
@@ -13,3 +20,4 @@
1320
"dhis2/webjars/<all>"
1421
]
1522
}
23+

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)