summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/config.json1
-rw-r--r--etc_upload/config.json3
-rw-r--r--restart_ph_in_docker.sh29
-rw-r--r--run_policy.sh1
-rw-r--r--start_ph_in_docker.sh70
5 files changed, 3 insertions, 101 deletions
diff --git a/etc/config.json b/etc/config.json
index e54569b..b83cd09 100644
--- a/etc/config.json
+++ b/etc/config.json
@@ -1,4 +1,5 @@
{
+ "version" : "1.0.0",
"wservice_port" : 25577,
"policy_handler" : {
"system" : "policy_handler"
diff --git a/etc_upload/config.json b/etc_upload/config.json
index 920a9be..e143773 100644
--- a/etc_upload/config.json
+++ b/etc_upload/config.json
@@ -19,7 +19,6 @@
},
"target_entity" : "policy_engine"
},
- "deploy_handler_" : "policy_deploy_handler",
- "deploy_handler" : "alex_dh"
+ "deploy_handler" : "deployment_handler"
}
}
diff --git a/restart_ph_in_docker.sh b/restart_ph_in_docker.sh
deleted file mode 100644
index 08ba299..0000000
--- a/restart_ph_in_docker.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# org.onap.dcae
-# ================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
-docker stop policy_handler
-docker rm policy_handler
-docker rmi policy_handler
-docker build -t policy_handler .
-
-RUNSCRIPT=$(dirname $0)/start_ph_in_docker.sh
-echo "running script ${RUNSCRIPT}"
-${RUNSCRIPT}
diff --git a/run_policy.sh b/run_policy.sh
index 6849699..8fa23a2 100644
--- a/run_policy.sh
+++ b/run_policy.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+# ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
diff --git a/start_ph_in_docker.sh b/start_ph_in_docker.sh
deleted file mode 100644
index e94bdb0..0000000
--- a/start_ph_in_docker.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash
-
-# org.onap.dcae
-# ================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
-APPNAME=policy_handler
-
-
-if [[ -n ${DOCKER_HOST} ]]; then
- # DOCKER_HOSTNAME=${DOCKER_HOST//*(tcp:|:*[0-9]|\/)/}
- DOCKER_HOSTNAME=${DOCKER_HOST//tcp:/}
- DOCKER_HOSTNAME=${DOCKER_HOSTNAME//:*[0-9]/}
- DOCKER_HOSTNAME=${DOCKER_HOSTNAME//\//}
- echo "${APPNAME} on DOCKER_HOSTNAME=${DOCKER_HOSTNAME}"
- export HOSTNAME=${DOCKER_HOSTNAME}
-
- # replace CONSUL_IP with docker-host-ip if consul-agent is local
- CONSUL_HOST=${HOSTNAME}
- CONSUL_IP=$(host ${CONSUL_HOST} | awk '/has address/ { print $4 ; exit }')
- if [ "0${CONSUL_IP}" = "0" ]; then
- CONSUL_IP=${CONSUL_HOST}
- fi
-
- echo "starting ${APPNAME} on HOSTNAME=${HOSTNAME} CONSUL_HOST=${CONSUL_HOST} CONSUL_IP=${CONSUL_IP}"
-
- docker run --name ${APPNAME} -d -e HOSTNAME --add-host consul:${CONSUL_IP} -P ${APPNAME}
-else
- export HOSTNAME=$(hostname --fqdn)
-
- # replace CONSUL_IP with docker-host-ip if consul-agent is local
- CONSUL_HOST=${HOSTNAME}
- CONSUL_IP=$(host ${CONSUL_HOST} | awk '/has address/ { print $4 ; exit }')
-
- echo "starting ${APPNAME} on HOSTNAME=${HOSTNAME} CONSUL_HOST=${CONSUL_HOST} CONSUL_IP=${CONSUL_IP}"
-
- BASEDIR=$(pwd)
- TARGETDIR=/opt/app/${APPNAME}
-
- mkdir -p ${BASEDIR}/logs
-
- docker run --name ${APPNAME} -d \
- -e HOSTNAME \
- --add-host consul:${CONSUL_IP} \
- -v ${BASEDIR}/etc:${TARGETDIR}/etc \
- -v ${BASEDIR}/logs:${TARGETDIR}/logs \
- -p 25577:25577 \
- ${APPNAME}
-fi
-
-docker ps -a | grep ${APPNAME}
-echo "--- --- --- --- ---"
-docker exec ${APPNAME} sh -c "whoami;pwd;set;ls -la;ls -l logs"
-echo "copy logs: docker cp ${APPNAME}:/opt/app/${APPNAME}/logs logs/"
-echo "export logs: docker logs ${APPNAME} > logs/"'$(date +%Y_%m%d-%H%M%S)_'"${APPNAME}.log 2>&1"