From a5bfd6aed8b182416ef1cf0ce88dbc0b61d92fa0 Mon Sep 17 00:00:00 2001 From: Alex Shatov Date: Fri, 15 Sep 2017 14:03:13 -0400 Subject: version and proper deployment_handler in config Change-Id: I4cde9c4a2e1305519458658479a1c19c36c80a5b Issue-Id: DCAEGEN2-62 Signed-off-by: Alex Shatov --- etc/config.json | 1 + etc_upload/config.json | 3 +-- restart_ph_in_docker.sh | 29 -------------------- run_policy.sh | 1 + start_ph_in_docker.sh | 70 ------------------------------------------------- 5 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 restart_ph_in_docker.sh delete mode 100644 start_ph_in_docker.sh 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" -- cgit 1.2.3-korg