Skip to content

Commit 0925204

Browse files
Merge pull request #23 from OpenLMIS/4.5.1-SNAPSHOT
Stabilize consul registration and health checks
2 parents e39eaf5 + 54c1366 commit 0925204

File tree

12 files changed

+1994
-636
lines changed

12 files changed

+1994
-636
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
4.4.0 / 2025-11-27
58
=================
69

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@ 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 /
13+

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ repositories {
3535
}
3636

3737
dependencies {
38+
compile "org.springframework.boot:spring-boot-starter-actuator"
3839
compile "org.springframework.boot:spring-boot-starter-web"
3940
compile "org.springframework.boot:spring-boot-starter-security"
4041
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
@@ -245,5 +246,5 @@ build {
245246
dependsOn jacocoTestReport
246247
dependsOn ramlToHtml
247248
dependsOn copyRamlHtmlToBuild
248-
dependsOn copyConsulRegistrationToBuild
249+
dependsOn prepareConsulBuild
249250
}

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": "auth",
4+
"Id": "auth-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
"auth",
1017
"auth/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)