From: MD IRSHAD SHEIKH Date: Mon, 26 Jul 2021 12:33:45 +0000 (+0530) Subject: Added mariadb connectivity and solved certificate issue X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=4ac159ec1a45b1d538baeb1ba01d89980d6acf42;p=so.git Added mariadb connectivity and solved certificate issue Issue-ID: SO-3674 Signed-off-by: MD IRSHAD SHEIKH Change-Id: Idc0ed441d1371b057b7c3a80c8c675c66be95fe7 --- diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-bpmn-infra b/packages/docker/src/main/docker/docker-files/Dockerfile.so-bpmn-infra index 86c96174dc..d735827469 100644 --- a/packages/docker/src/main/docker/docker-files/Dockerfile.so-bpmn-infra +++ b/packages/docker/src/main/docker/docker-files/Dockerfile.so-bpmn-infra @@ -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 diff --git a/packages/docker/src/main/docker/docker-files/scripts/start-app.sh b/packages/docker/src/main/docker/docker-files/scripts/start-app.sh index 74d17fc9b7..54cf95e1cb 100755 --- a/packages/docker/src/main/docker/docker-files/scripts/start-app.sh +++ b/packages/docker/src/main/docker/docker-files/scripts/start-app.sh @@ -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