From c7f57ec4a467bcac62ef0fdd655593e0c937e9ee Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Thu, 31 Aug 2017 14:26:21 +0300 Subject: [DevOps] - Added local run to docker_run script and fixed webseal-simulator pom.xml Change-Id: I8715bf5d7713a0f1b9192c6b8fd7303f01747546 Issue-Id: SDC-152 Signed-off-by: Idan Amit --- sdc-os-chef/scripts/docker_run.sh | 47 +++++++++++++++++++++++++++++++-------- utils/webseal-simulator/pom.xml | 28 ++++++++++++++++++++++- 2 files changed, 65 insertions(+), 10 deletions(-) diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh index 23c443e22d..2ef4f6a2bf 100755 --- a/sdc-os-chef/scripts/docker_run.sh +++ b/sdc-os-chef/scripts/docker_run.sh @@ -2,13 +2,13 @@ function usage { - echo "usage: docker_run.sh [ -r|--release ] [ -e|--environment ] [ -p|--port ] [ -h|--help ]" + echo "usage: docker_run.sh [ -r|--release ] [ -e|--environment ] [ -p|--port ] [ -l|--local ] [ -h|--help ]" } function cleanup { echo "performing old dockers cleanup" - docker_ids=`docker ps -a | egrep "ecomp-nexus:${PORT}/sdc|sdc|Exit" | awk '{print $1}'` + docker_ids=`docker ps -a | egrep -v "openecomp/sdc-simulator" | egrep "ecomp-nexus:${PORT}/sdc|sdc|Exit" | awk '{print $1}'` for X in ${docker_ids} do docker rm -f ${X} @@ -24,6 +24,7 @@ function dir_perms { RELEASE=latest +LOCAL=false [ -f /opt/config/env_name.txt ] && DEP_ENV=$(cat /opt/config/env_name.txt) || DEP_ENV=__ENV-NAME__ [ -f /opt/config/nexus_username.txt ] && NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) || NEXUS_USERNAME=release [ -f /opt/config/nexus_password.txt ] && NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) || NEXUS_PASSWD=sfWU3DFVdBr7GVxB85mTYgAW @@ -43,6 +44,10 @@ while [ "$1" != "" ]; do shift PORT=${1} ;; + -l | --local ) + shift + LOCAL=true + ;; -h | --help ) usage exit @@ -61,6 +66,11 @@ cleanup export IP=`ifconfig eth0 | awk -F: '/inet addr/ {gsub(/ .*/,"",$2); print $2}'` +export PREFIX=${NEXUS_DOCKER_REPO}'/openecomp' + +if [ ${LOCAL} = true ]; then + PREFIX='openecomp' +fi echo "" @@ -74,6 +84,20 @@ docker run --detach --name sdc-es --env ENVNAME="${DEP_ENV}" --log-driver=json-f echo "docker run sdc-cassandra..." docker pull ${NEXUS_DOCKER_REPO}/openecomp/sdc-cassandra:${RELEASE} docker run --detach --name sdc-cs --env RELEASE="${RELEASE}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/CS:/var/lib/cassandra --volume /data/environments:/root/chef-solo/environments --publish 9042:9042 --publish 9160:9160 ${NEXUS_DOCKER_REPO}/openecomp/sdc-cassandra:${RELEASE} +echo "docker run sdc-elasticsearch..." +if [ ${LOCAL} = false ]; then + echo "pulling code" + docker pull ${PREFIX}/sdc-elasticsearch:${RELEASE} +fi +docker run --detach --name sdc-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --memory 1g --memory-swap=1g --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro -e ES_HEAP_SIZE=1024M --volume /data/ES:/usr/share/elasticsearch/data --volume /data/environments:/root/chef-solo/environments --publish 9200:9200 --publish 9300:9300 ${PREFIX}/sdc-elasticsearch:${RELEASE} + + +# cassandra +echo "docker run sdc-cassandra..." +if [ ${LOCAL} = false ]; then + docker pull ${PREFIX}/sdc-cassandra:${RELEASE} +fi +docker run --detach --name sdc-cs --env RELEASE="${RELEASE}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/CS:/var/lib/cassandra --volume /data/environments:/root/chef-solo/environments --publish 9042:9042 --publish 9160:9160 openecomp/sdc-cassandra:${RELEASE} echo "please wait while CS is starting..." @@ -87,18 +111,21 @@ while [ $c -gt 0 ]; do done echo -e "" - # kibana echo "docker run sdc-kibana..." -docker pull ${NEXUS_DOCKER_REPO}/openecomp/sdc-kibana:${RELEASE} -docker run --detach --name sdc-kbn --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 2g --memory-swap=2g --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/environments:/root/chef-solo/environments --publish 5601:5601 ${NEXUS_DOCKER_REPO}/openecomp/sdc-kibana:${RELEASE} +if [ ${LOCAL} = false ]; then + docker pull ${PREFIX}/sdc-kibana:${RELEASE} +fi +docker run --detach --name sdc-kbn --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 2g --memory-swap=2g --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/environments:/root/chef-solo/environments --publish 5601:5601 ${PREFIX}/sdc-kibana:${RELEASE} dir_perms # Back-End echo "docker run sdc-backend..." -docker pull ${NEXUS_DOCKER_REPO}/openecomp/sdc-backend:${RELEASE} -docker run --detach --name sdc-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 4g --memory-swap=4g --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/logs/BE/:/var/lib/jetty/logs --volume /data/environments:/root/chef-solo/environments --publish 8443:8443 --publish 8080:8080 ${NEXUS_DOCKER_REPO}/openecomp/sdc-backend:${RELEASE} +if [ ${LOCAL} = false ]; then + docker pull ${PREFIX}/sdc-backend:${RELEASE} +fi +docker run --detach --name sdc-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env http_proxy=${http_proxy} --env https_proxy=${https_proxy} --env no_proxy=${no_proxy} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 4g --memory-swap=4g --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/logs/BE/:/var/lib/jetty/logs --volume /data/environments:/root/chef-solo/environments --publish 8443:8443 --publish 8080:8080 ${PREFIX}/sdc-backend:${RELEASE} echo "please wait while BE is starting..." echo "" @@ -114,8 +141,10 @@ echo -e "" # Front-End echo "docker run sdc-frontend..." -docker pull ${NEXUS_DOCKER_REPO}/openecomp/sdc-frontend:${RELEASE} -docker run --detach --name sdc-FE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 2g --memory-swap=2g --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/logs/FE/:/var/lib/jetty/logs --volume /data/environments:/root/chef-solo/environments --publish 9443:9443 --publish 8181:8181 ${NEXUS_DOCKER_REPO}/openecomp/sdc-frontend:${RELEASE} +if [ ${LOCAL} = false ]; then + docker pull ${PREFIX}/sdc-frontend:${RELEASE} +fi +docker run --detach --name sdc-FE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env http_proxy=${http_proxy} --env https_proxy=${https_proxy} --env no_proxy=${no_proxy} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 2g --memory-swap=2g --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/logs/FE/:/var/lib/jetty/logs --volume /data/environments:/root/chef-solo/environments --publish 9443:9443 --publish 8181:8181 ${PREFIX}/sdc-frontend:${RELEASE} diff --git a/utils/webseal-simulator/pom.xml b/utils/webseal-simulator/pom.xml index 7bee699dab..ea620f6844 100644 --- a/utils/webseal-simulator/pom.xml +++ b/utils/webseal-simulator/pom.xml @@ -13,6 +13,7 @@ ${project.version}-latest yyyyMMdd'T'HHmm + https://nexus.onap.org @@ -51,7 +52,7 @@ commons-codec commons-codec - 2.0-SNAPSHOT + 1.9 compile @@ -112,6 +113,31 @@ + + + + ecomp-releases + Release Repository + ${nexus.proxy}/content/repositories/releases/ + + + ecomp-staging + Staging Repository + ${nexus.proxy}/content/repositories/staging/ + + + ecomp-snapshots + Snapshots Repository + ${nexus.proxy}/content/repositories/snapshots/ + + + ecomp-public + Public Repository + ${nexus.proxy}/content/repositories/public/ + + + + docker-staging -- cgit 1.2.3-korg