Add health check script 31/19331/1
authorMichael Hwang <mhwang@research.att.com>
Tue, 17 Oct 2017 16:03:49 +0000 (12:03 -0400)
committerMichael Hwang <mhwang@research.att.com>
Tue, 17 Oct 2017 16:05:58 +0000 (12:05 -0400)
Change-Id: I0e51de51b4c205b60e5dc8286be8bc4217e5d5db
Issue-Id: DCAEGEN2-142
Signed-off-by: Michael Hwang <mhwang@research.att.com>
pom.xml
resources/health.sh [new file with mode: 0755]

diff --git a/pom.xml b/pom.xml
index 0157788..42426e8 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                     <baseImage>java:8-jre</baseImage>
                     <!-- NOTE: Couldn't figure out how to package the jar to be named: ${project.build.finalName}. This might be
                             because of the clojure maven plugin -->
-                    <entryPoint>["java", "-jar", "/opt/servicechange-handler.jar", "prod", "http://consul:8500/v1/kv/service-change-handler?raw=true"]</entryPoint>
+                    <cmd>["java", "-jar", "/opt/servicechange-handler.jar", "prod", "http://consul:8500/v1/kv/service-change-handler?raw=true"]</cmd>
                     <!-- copy the service's jar file from target into the root directory of the image -->
                     <resources>
                         <resource>
                             <directory>${project.build.directory}</directory>
                             <include>servicechange-handler.jar</include>
                         </resource>
+                        <resource>
+                            <targetPath>/opt</targetPath>
+                            <directory>${project.basedir}/resources</directory>
+                            <include>health.sh</include>
+                        </resource>
                     </resources>
                     <serverId>${onap.nexus.dockerregistry.daily}</serverId>
                 </configuration>
diff --git a/resources/health.sh b/resources/health.sh
new file mode 100755 (executable)
index 0000000..5fe8236
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Health check script for service change handler
+
+# Currently, the simple existence of the running container is assumed to indicate
+# health. A better possible health check is if the distribution client provided a
+# health check call.
+
+exit 0