diff options
author | 2024-07-02 10:00:57 +0200 | |
---|---|---|
committer | 2024-07-04 11:55:05 +0200 | |
commit | 9e6101e4b225804fbe38f40ebd49516e5e10ecce (patch) | |
tree | 53fda1055ad1ab26c2e98a0166aca860e8c8fc47 /aai-traversal/src/main/scripts/install/updateQueryData.sh | |
parent | 589066bc5238e8d86fe893949d1a48cfdc16309b (diff) |
Use eclipse-temurin:8-jre-alpine docker base image in aai-traversal
- replace aai-common base image with plain java 8 jre
- remove custom folders and users to simplify setup
- fix janino, guava and activemq vulnerabilities
- remove apache httpclient, jsonassert, aaf-cadi and spring-test dependencies
Issue-ID: AAI-3913
Change-Id: Icca637b5adb8e9a480912c4e2b7d9e83ee3e29ba
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-traversal/src/main/scripts/install/updateQueryData.sh')
-rwxr-xr-x[-rw-r--r--] | aai-traversal/src/main/scripts/install/updateQueryData.sh | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/aai-traversal/src/main/scripts/install/updateQueryData.sh b/aai-traversal/src/main/scripts/install/updateQueryData.sh index 7b5d1b3..9884efe 100644..100755 --- a/aai-traversal/src/main/scripts/install/updateQueryData.sh +++ b/aai-traversal/src/main/scripts/install/updateQueryData.sh @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/sh # # ============LICENSE_START======================================================= # org.onap.aai @@ -22,8 +22,8 @@ # PROGNAME=$(basename $0) -PROJECT_HOME=/opt/app/aai-traversal -OUTFILE=$PROJECT_HOME/logs/misc/${PROGNAME}.log.$(date +\%Y-\%m-\%d) + +: ${PROJECT_HOME:=/opt/app/aai-traversal} if [ "$1" = "--debug" ]; then set -x; @@ -31,16 +31,8 @@ fi; TS=$(date "+%Y-%m-%d %H:%M:%S") -CHECK_USER="aaiadmin" -userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) -if [ "${userid}" != $CHECK_USER ]; then - echo "You must be $CHECK_USER to run $0. The id used $userid." - exit 1 -fi - error_exit () { echo "${PROGNAME}: failed for ${1:-"Unknown error"} on cmd $2" 1>&2 - echo "${PROGNAME}: failed for ${1:-"Unknown error"} on cmd $2" >> $OUTFILE # exit ${2:-"1"} } @@ -54,11 +46,11 @@ vers=`grep model-invariant-id $filepath|cut -d':' -f2|cut -d'"' -f2` # last parameter will skip put if it exists resource=service-design-and-creation/models/model/$vers if [ "$1" = "--debug" ]; then - bash -x $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j -else - $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + sh -x $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j +else + $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j fi; -echo "End putTool for widget $filename" | tee -a $OUTFILE +echo "End putTool for widget $filename" done j=0 @@ -66,16 +58,16 @@ for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/named-query-json/*.js do j=$(expr "$j" + 1) filename=$(basename $filepath) -echo "Begin putTool for named-query $filename" | tee -a $OUTFILE +echo "Begin putTool for named-query $filename" vers=`grep named-query-uuid $filepath|cut -d':' -f2|cut -d'"' -f2` # last parameter will skip put if it exists resource=service-design-and-creation/named-queries/named-query/$vers if [ "$1" = "--debug" ]; then - bash -x $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + bash -x $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j else - $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j fi; -echo "End putTool for named-query $filename" | tee -a $OUTFILE +echo "End putTool for named-query $filename" done j=0 @@ -83,16 +75,16 @@ for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/resource-model-json/* do j=$(expr "$j" + 1) filename=$(basename $filepath) -echo "Begin putTool for resource model $filename" | tee -a $OUTFILE +echo "Begin putTool for resource model $filename" vers=`grep model-invariant-id $filepath|cut -d':' -f2|cut -d'"' -f2` # last parameter will skip put if it exists resource=service-design-and-creation/models/model/$vers if [ "$1" = "--debug" ]; then - bash -x $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + bash -x $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j else - $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j fi; -echo "End putTool for resource model $filename" | tee -a $OUTFILE +echo "End putTool for resource model $filename" done j=0 @@ -100,19 +92,18 @@ for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/service-model-json/*. do j=$(expr "$j" + 1) filename=$(basename $filepath) -echo "Begin putTool for service model $filename" | tee -a $OUTFILE +echo "Begin putTool for service model $filename" vers=`grep model-invariant-id $filepath|cut -d':' -f2|cut -d'"' -f2` # last parameter will skip put if it exists resource=service-design-and-creation/models/model/$vers if [ "$1" = "--debug" ]; then - bash -x $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + bash -x $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j else - $PROJECT_HOME/scripts/putTool.sh $resource $filepath 412 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j + $PROJECT_HOME/bin/putTool.sh $resource $filepath 412 2>&1 || error_exit "$resource $filepath" $j fi; -echo "End putTool for service model $filename" | tee -a $OUTFILE +echo "End putTool for service model $filename" done -echo "$PROGNAME completed ${TS}" | tee -a $OUTFILE -echo "See output and error file: $OUTFILE" +echo "$PROGNAME completed ${TS}" exit 0 |