Code Review
/
dmaap
/
buscontroller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove eelf dependency
[dmaap/buscontroller.git]
/
misc
/
dmaapbc
diff --git
a/misc/dmaapbc
b/misc/dmaapbc
index
0dff4d6
..
aca8f9e
100644
(file)
--- a/
misc/dmaapbc
+++ b/
misc/dmaapbc
@@
-31,8
+31,9
@@
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/
export PATH
CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'`
export CLASSPATH
export PATH
CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'`
export CLASSPATH
-CONFIGMAP_ROOT=/opt/app/config
-CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf
+CONFIGMAP_ROOT=${CONFIGMAP_ROOT:-/opt/app/config}
+CONFIGMAP_PROPS=${CONFIGMAP_PROPS:-$CONFIGMAP_ROOT/conf/dmaapbc.properties}
+CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf/buscontroller.env
MAIN=org.onap.dmaap.dbcapi.server.Main
MAIN=org.onap.dmaap.dbcapi.server.Main
@@
-44,6
+45,7
@@
pids() {
}
config() {
}
config() {
+ echo "ENTER config"
set -x
if [ ! -d $APP_ROOT ]
then
set -x
if [ ! -d $APP_ROOT ]
then
@@
-52,8
+54,8
@@
config() {
fi
if [ ! -f $CONTAINER_CONFIG ]
then
fi
if [ ! -f $CONTAINER_CONFIG ]
then
- echo "
Expected env file $CONTAINER_CONFIG not found
"
- exit 1
+ echo "
WARNING: Expected env file $CONTAINER_CONFIG not found. Default behaviors in effect
"
+ find $CONTAINER_ROOT -type f
fi
cd $APP_ROOT
source $CONTAINER_CONFIG
fi
cd $APP_ROOT
source $CONTAINER_CONFIG
@@
-76,10
+78,13
@@
config() {
chmod +x etc/havecert
# These files might be better provided in kubernetes configmaps
chmod +x etc/havecert
# These files might be better provided in kubernetes configmaps
- # so if they are
already there, don't overwrite.
- if [
! -f etc/dmaapbc.properties
]
+ # so if they are
there, use them
+ if [
-f $CONFIGMAP_PROPS
]
then
then
- . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties
+ PROPS=$CONFIGMAP_PROPS
+ else
+ PROPS=etc/dmaapbc.properties
+ . misc/dmaapbc.properties.tmpl > $PROPS
fi
if [ ! -f config/PolicyEngineApi.properties ]
then
fi
if [ ! -f config/PolicyEngineApi.properties ]
then
@@
-89,6
+94,7
@@
config() {
}
start() {
}
start() {
+ echo "ENTER start"
set -x
ID=`id -n -u`
GRP=`id -n -g`
set -x
ID=`id -n -u`
GRP=`id -n -g`
@@
-103,6
+109,7
@@
start() {
exit 1
fi
cd $APP_ROOT
exit 1
fi
cd $APP_ROOT
+ pwd
if etc/havecert
then
if etc/havecert
then
@@
-121,7
+128,7
@@
start() {
# JVM flags
#old line from Dockerfile...keep for reference only
# JVM flags
#old line from Dockerfile...keep for reference only
- FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -D
dmaapbc.properties=etc/dmaapbc.properties
-Dlogback.configurationFile=etc/logback.xml -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
+ FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -D
ConfigFile=$PROPS
-Dlogback.configurationFile=etc/logback.xml -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
#nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
nohup java $FLAGS $MAIN </dev/null &
sleep 5
#nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 &
nohup java $FLAGS $MAIN </dev/null &
sleep 5
@@
-130,6
+137,7
@@
start() {
}
stop() {
}
stop() {
+ echo "ENTER stop"
ID=`id -n -u`
GRP=`id -n -g`
if [ "$ID" != "$USER" ]
ID=`id -n -u`
GRP=`id -n -g`
if [ "$ID" != "$USER" ]
@@
-156,6
+164,7
@@
stop() {
}
status() {
}
status() {
+ echo "ENTER status"
PIDS=`pids`
if [ "$PIDS" != "" ]
then
PIDS=`pids`
if [ "$PIDS" != "" ]
then
@@
-166,6
+175,7
@@
status() {
}
init() {
}
init() {
+ echo "ENTER init"
if [ ! -d $CONFIGMAP_ROOT ]
then
echo $CONFIGMAP_ROOT does not exist
if [ ! -d $CONFIGMAP_ROOT ]
then
echo $CONFIGMAP_ROOT does not exist
@@
-182,6
+192,7
@@
init() {
done
cd $CONFIGMAP_ROOT
done
cd $CONFIGMAP_ROOT
+ pwd
# order is important in this next list
for uri in dmaap dcaeLocations mr_clusters topics feeds
do
# order is important in this next list
for uri in dmaap dcaeLocations mr_clusters topics feeds
do
@@
-189,7
+200,9
@@
init() {
then
for j in `ls ${uri}/*.json`
do
then
for j in `ls ${uri}/*.json`
do
- curl -v -X POST -H "Content-Type: application/json" -d @${j} http://dmaap-bc:8080/webapi/${uri}
+ echo "POST $j to $uri"
+ rc=`curl -v -X POST -w "%{http_code}" -H "Content-Type: application/json" -d @${j} http://dmaap-bc:8080/webapi/${uri}`
+ echo "response=$rc"
done
fi
done
done
fi
done