aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2017-08-31 14:26:21 +0300
committerIdan Amit <ia096e@intl.att.com>2017-08-31 14:26:21 +0300
commitc7f57ec4a467bcac62ef0fdd655593e0c937e9ee (patch)
tree7e11abc1ee65fa855176db4b04fd5a9b8c886ddd /sdc-os-chef
parent7cd1156c3cab009146ca02989df394412d209483 (diff)
[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 <ia096e@intl.att.com>
Diffstat (limited to 'sdc-os-chef')
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh47
1 files changed, 38 insertions, 9 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 <RELEASE-NAME> ] [ -e|--environment <ENV-NAME> ] [ -p|--port <Docker-hub-port>] [ -h|--help ]"
+ echo "usage: docker_run.sh [ -r|--release <RELEASE-NAME> ] [ -e|--environment <ENV-NAME> ] [ -p|--port <Docker-hub-port>] [ -l|--local <Run-without-pull>] [ -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}