Add healthcheck script 63/73363/4
authorFilip Krzywka <filip.krzywka@nokia.com>
Thu, 22 Nov 2018 10:09:03 +0000 (11:09 +0100)
committerFilip Krzywka <filip.krzywka@nokia.com>
Thu, 22 Nov 2018 10:21:30 +0000 (11:21 +0100)
To be used in HV-VES deployment template

Change-Id: I87e1d52db2bb530e131837052f55a29adb5d524b
Issue-ID: DCAEGEN2-794
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
hv-collector-main/Dockerfile
hv-collector-main/src/main/scripts/healthcheck.sh [new file with mode: 0755]

index 8049abc..0170b64 100644 (file)
@@ -15,4 +15,5 @@ ENTRYPOINT ["java", "-cp", "*:", "org.onap.dcae.collectors.veshv.main.MainKt"]
 
 COPY target/libs/external/* ./
 COPY target/libs/internal/* ./
+COPY src/main/scripts/healthcheck.sh ./
 COPY target/hv-collector-main-*.jar ./
diff --git a/hv-collector-main/src/main/scripts/healthcheck.sh b/hv-collector-main/src/main/scripts/healthcheck.sh
new file mode 100755 (executable)
index 0000000..db62eec
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+curl -f http://localhost:${VESHV_HEALTH_CHECK_API_PORT:-6060}/health/ready || exit 1
+nc -vz localhost ${VESHV_LISTEN_PORT:-6061} || exit 2