Added mariadb connectivity and solved certificate issue 55/122855/1
authorMD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Mon, 26 Jul 2021 12:33:45 +0000 (18:03 +0530)
committerMD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Mon, 26 Jul 2021 12:35:07 +0000 (18:05 +0530)
Issue-ID: SO-3674

Signed-off-by: MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Change-Id: Idc0ed441d1371b057b7c3a80c8c675c66be95fe7

packages/docker/src/main/docker/docker-files/Dockerfile.so-bpmn-infra
packages/docker/src/main/docker/docker-files/scripts/start-app.sh

index 86c9617..d735827 100644 (file)
@@ -14,3 +14,4 @@ VOLUME /camunda/app/config
 
 COPY maven/app.war /camunda/webapps/mso.war
 COPY scripts/wait-for.sh /camunda
+COPY scripts/start-app.sh /camunda
index 74d17fc..54cf95e 100755 (executable)
@@ -1,24 +1,41 @@
 #!/bin/sh
 
+#Copying mariadb-java-client for connectivity to mariadb
+unzip /camunda/webapps/mso.war
+cp /camunda/WEB-INF/lib/mariadb-java-client-2.6.2.jar /camunda/lib
+
 if [ `id -u` = 0 ]
 then
        # Install certificates found in the /app/ca-certificates volume, if any.
 
        needUpdate=FALSE
-
-       for certificate in `ls -1 /app/ca-certificates`; do
-               echo "Installing $certificate in /usr/local/share/ca-certificates"
-               cp /app/ca-certificates/$certificate /usr/local/share/ca-certificates/$certificate
-               needUpdate=TRUE
-       done
+       if [ ${APP} = "bpmn-infra" ]; then
+        for certificate in `ls -1 /camunda/app/ca-certificates`; do
+            echo "Installing $certificate in /usr/local/share/ca-certificates"
+            cp /camunda/app/ca-certificates/$certificate /usr/local/share/ca-certificates/$certificate
+            needUpdate=TRUE
+        done
+    else
+         for certificate in `ls -1 /app/ca-certificates`; do
+            echo "Installing $certificate in /usr/local/share/ca-certificates"
+            cp /app/ca-certificates/$certificate /usr/local/share/ca-certificates/$certificate
+            needUpdate=TRUE
+         done
+    fi
 
        if [ $needUpdate = TRUE ]; then
                update-ca-certificates --fresh
        fi
 
-       # Re-exec this script as the 'onap' user.
-       this=`readlink -f $0`
-       exec su so -c  "$this"
+    if [ ${APP} = "bpmn-infra" ]; then
+        # Re-exec this script as the 'camunda' user.
+        this=`readlink -f $0`
+        exec su camunda -c  "$this"
+    else
+        # Re-exec this script as the 'onap' user.
+        this=`readlink -f $0`
+        exec su so -c  "$this"
+    fi
 fi
 
 touch /app/app.jar
@@ -98,21 +115,29 @@ read_properties(){
 }
 
 
-
-if [ -n "${AAF_SSL_CERTS_ENABLED}" ]; then
-read_properties "$(head -n 4 /app/certs/.passphrases)"
+if [ ${APP} = "bpmn-infra" ]; then
+    if [ -n "${AAF_SSL_CERTS_ENABLED}" ]; then
+      read_properties "$(head -n 4 /camunda/app/certs/.passphrases)"
+    fi
+else
+   if [ -n "${AAF_SSL_CERTS_ENABLED}" ]; then
+     read_properties "$(head -n 4 /app/certs/.passphrases)"
+   fi
 fi
 
 echo "JVM Arguments: ${jvmargs}"
 
-java ${jvmargs} -jar app.jar
-rc=$?
+if [ ! ${APP} = "bpmn-infra" ]; then
+       java ${jvmargs} -jar app.jar
+    rc=$?
+    echo "Application exiting with status code $rc"
 
-echo "Application exiting with status code $rc"
+    if [ ! -z "${EXIT_DELAY}" -a "${EXIT_DELAY}" != 0 ]; then
+        echo "Delaying $APP exit for $EXIT_DELAY seconds"
+        sleep $EXIT_DELAY
+    fi
 
-if [ ! -z "${EXIT_DELAY}" -a "${EXIT_DELAY}" != 0 ]; then
-       echo "Delaying $APP exit for $EXIT_DELAY seconds"
-       sleep $EXIT_DELAY
+    exit $rc
+else
+   ./camunda.sh
 fi
-
-exit $rc