From c3bda48fbb4250bc409afe44684a147d0b08573c Mon Sep 17 00:00:00 2001 From: Grinberg Moti Date: Thu, 23 Feb 2017 11:24:34 +0200 Subject: set url to https://omnitruck.chef.io/install.sh Change-Id: I1eb228adf80e44d97a0a95eb37477ee1c0d76ab9 Signed-off-by: Grinberg Moti --- sdc-os-chef/scripts/docker_run.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'sdc-os-chef/scripts') diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh index efae7fd2df..c6e316f91e 100644 --- a/sdc-os-chef/scripts/docker_run.sh +++ b/sdc-os-chef/scripts/docker_run.sh @@ -1,12 +1,28 @@ #!/bin/bash -function usage -{ +function usage { echo "usage: docker_run.sh [ -r|--release ] [ -e|--environment ] [ -p|--port ] [ -h|--help ]" } +function cleanup { + echo "performing old dockers cleanup" + docker_ids=`docker ps -a | egrep "ecomp-nexus:${PORT}/sdc|sdc|Exit" | awk '{print $1}'` + for X in ${docker_ids} + do + docker rm -f ${X} + done +} + + +function dir_perms { + mkdir -p /data/logs/BE/ASDC/ASDC-BE + mkdir -p /data/logs/FE/ASDC/ASDC-FE + chmod -R 775 /data/logs +} + + RELEASE=latest [ -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 @@ -41,13 +57,8 @@ done [ -f /opt/config/nexus_username.txt ] && docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -# cleanup -echo "performing old dockers cleanup" -docker_ids=`docker ps -a | egrep "ecomp-nexus:${PORT}/sdc|sdc|Exit" | awk '{print $1}'` -for X in ${docker_ids} -do - docker rm -f ${X} -done +cleanup + export IP=`ifconfig eth0 | awk -F: '/inet addr/ {gsub(/ .*/,"",$2); print $2}'` @@ -82,6 +93,7 @@ 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} +dir_perms # Back-End echo "docker run sdc-backend..." -- cgit 1.2.3-korg