From a782bf8b4e45f598ee3894a224eec46c4d13ed1f Mon Sep 17 00:00:00 2001 From: Filip Krzywka Date: Thu, 22 Nov 2018 11:09:03 +0100 Subject: Add healthcheck script To be used in HV-VES deployment template Change-Id: I87e1d52db2bb530e131837052f55a29adb5d524b Issue-ID: DCAEGEN2-794 Signed-off-by: Filip Krzywka --- hv-collector-main/Dockerfile | 1 + hv-collector-main/src/main/scripts/healthcheck.sh | 4 ++++ 2 files changed, 5 insertions(+) create mode 100755 hv-collector-main/src/main/scripts/healthcheck.sh (limited to 'hv-collector-main') diff --git a/hv-collector-main/Dockerfile b/hv-collector-main/Dockerfile index 8049abca..0170b645 100644 --- a/hv-collector-main/Dockerfile +++ b/hv-collector-main/Dockerfile @@ -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 index 00000000..db62eece --- /dev/null +++ b/hv-collector-main/src/main/scripts/healthcheck.sh @@ -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 -- cgit 1.2.3-korg