Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 3 | CS_PASSWORD="onap123#@!" |
| 4 | SDC_USER="asdc_user" |
| 5 | SDC_PASSWORD="Aa1234%^!" |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 6 | |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 7 | function usage { |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 8 | echo "usage: docker_run.sh [ -r|--release <RELEASE-NAME> ] [ -e|--environment <ENV-NAME> ] [ -p|--port <Docker-hub-port>] [ -l|--local <Run-without-pull>] [ -t|--runTests <Run-with-sanityDocker>] [ -h|--help ]" |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 9 | } |
| 10 | |
| 11 | |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 12 | function cleanup { |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 13 | echo "performing old dockers cleanup" |
| 14 | docker_ids=`docker ps -a | egrep -v "openecomp/sdc-simulator" | egrep "ecomp-nexus:${PORT}/sdc|sdc|Exit" | awk '{print $1}'` |
| 15 | for X in ${docker_ids} |
| 16 | do |
| 17 | docker rm -f ${X} |
| 18 | done |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | |
| 22 | function dir_perms { |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 23 | mkdir -p ${WORKSPACE}/data/logs/BE/SDC/SDC-BE |
| 24 | mkdir -p ${WORKSPACE}/data/logs/FE/SDC/SDC-FE |
| 25 | chmod -R 777 ${WORKSPACE}/data/logs |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 26 | } |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 27 | function probe_cs { |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 28 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 29 | cs_stat=false |
| 30 | docker exec -it $1 /var/lib/ready-probe.sh > /dev/null 2>&1 |
| 31 | rc=$? |
| 32 | if [[ $rc == 0 ]]; then |
| 33 | echo DOCKER start finished in $2 seconds |
| 34 | cs_stat=true |
| 35 | fi |
| 36 | |
| 37 | } |
| 38 | |
| 39 | function probe_docker { |
| 40 | |
| 41 | match_result=false |
| 42 | MATCH=`docker logs --tail 30 $1 | grep "DOCKER STARTED"` |
| 43 | echo MATCH is -- $MATCH |
| 44 | |
| 45 | if [ -n "$MATCH" ]; then |
| 46 | echo DOCKER start finished in $2 seconds |
| 47 | match_result=true |
| 48 | fi |
| 49 | } |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 50 | function monitor_docker { |
| 51 | |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 52 | echo monitor $1 Docker |
| 53 | sleep 5 |
| 54 | TIME_OUT=900 |
| 55 | INTERVAL=20 |
| 56 | TIME=0 |
| 57 | while [ "$TIME" -lt "$TIME_OUT" ]; do |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 58 | if [ "$1" == "sdc-cs" ]; then |
| 59 | probe_cs $1 $TIME |
| 60 | if [[ $cs_stat == true ]]; then break; fi |
| 61 | else |
| 62 | probe_docker $1 $TIME |
| 63 | if [[ $match_result == true ]]; then break; fi |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 64 | fi |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 65 | echo Sleep: $INTERVAL seconds before testing if $1 DOCKER is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds |
| 66 | sleep $INTERVAL |
| 67 | TIME=$(($TIME+$INTERVAL)) |
| 68 | done |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 69 | |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 70 | if [ "$TIME" -ge "$TIME_OUT" ]; then |
| 71 | echo -e "\e[1;31mTIME OUT: DOCKER was NOT fully started in $TIME_OUT seconds... Could cause problems ...\e[0m" |
| 72 | fi |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 73 | |
| 74 | } |
| 75 | |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 76 | function healthCheck { |
| 77 | curl localhost:9200/_cluster/health?pretty=true |
| 78 | |
| 79 | echo "BE health-Check:" |
| 80 | curl http://localhost:8080/sdc2/rest/healthCheck |
| 81 | |
| 82 | echo "" |
| 83 | echo "" |
| 84 | echo "FE health-Check:" |
| 85 | curl http://localhost:8181/sdc1/rest/healthCheck |
| 86 | |
| 87 | |
| 88 | echo "" |
| 89 | echo "" |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 90 | healthCheck_http_code=$(curl -o /dev/null -w '%{http_code}' -H "Accept: application/json" -H "Content-Type: application/json" -H "USER_ID: jh0003" http://localhost:8080/sdc2/rest/v1/user/demo;) |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 91 | if [[ ${healthCheck_http_code} != 200 ]] |
| 92 | then |
| 93 | echo "Error [${healthCheck_http_code}] while user existance check" |
| 94 | return ${healthCheck_http_code} |
| 95 | fi |
| 96 | echo "check user existance: OK" |
| 97 | return ${healthCheck_http_code} |
| 98 | } |
| 99 | |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 100 | function elasticHealthCheck { |
| 101 | echo "Elastic Health-Check:" |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 102 | |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 103 | COUNTER=0 |
| 104 | while [ $COUNTER -lt 20 ]; do |
| 105 | echo "Waiting ES docker to start" |
| 106 | health_Check_http_code=$(curl -o /dev/null -w '%{http_code}' http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=120s) |
| 107 | if [[ "$health_Check_http_code" -eq 200 ]] |
| 108 | then |
| 109 | break |
| 110 | fi |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 111 | let COUNTER=COUNTER+1 |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 112 | sleep 4 |
| 113 | done |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 114 | |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 115 | healthCheck_http_code=$(curl -o /dev/null -w '%{http_code}' http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=120s) |
| 116 | if [[ "$health_Check_http_code" != 200 ]] |
| 117 | then |
| 118 | echo "Error [${healthCheck_http_code}] ES NOT started correctly" |
| 119 | exit ${healthCheck_http_code} |
| 120 | fi |
| 121 | echo "ES started correctly" |
| 122 | curl localhost:9200/_cluster/health?pretty=true |
| 123 | return ${healthCheck_http_code} |
| 124 | } |
| 125 | |
Grinberg Moti | 9724621 | 2017-02-21 19:30:31 +0200 | [diff] [blame] | 126 | RELEASE=latest |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 127 | LOCAL=false |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 128 | RUNTESTS=false |
Tal Gitelman | 8e5fc51 | 2017-10-23 13:49:06 +0300 | [diff] [blame] | 129 | DEBUG_PORT="--publish 4000:4000" |
Tal Gitelman | e224d0b | 2017-10-17 15:24:25 +0300 | [diff] [blame] | 130 | |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 131 | while [ $# -gt 0 ]; do |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 132 | case $1 in |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 133 | # -r | --release - The specific docker version to pull and deploy |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 134 | -r | --release ) |
| 135 | shift 1 ; |
| 136 | RELEASE=$1; |
| 137 | shift 1;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 138 | # -e | --environment - The environment name you want to deploy |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 139 | -e | --environment ) |
| 140 | shift 1; |
| 141 | DEP_ENV=$1; |
| 142 | shift 1 ;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 143 | # -p | --port - The port from which to connect to the docker nexus |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 144 | -p | --port ) |
| 145 | shift 1 ; |
| 146 | PORT=$1; |
| 147 | shift 1 ;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 148 | # -l | --local - Use this for deploying your local dockers without pulling them first |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 149 | -l | --local ) |
| 150 | LOCAL=true; |
| 151 | shift 1;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 152 | # -t | --runTests - Use this for running the sanity tests docker after all other dockers have been deployed |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 153 | -t | --runTests ) |
| 154 | RUNTESTS=true; |
| 155 | shift 1 ;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 156 | # -h | --help - Display the help message with all the available run options |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 157 | -h | --help ) |
| 158 | usage; |
| 159 | exit 0;; |
| 160 | * ) |
| 161 | usage; |
| 162 | exit 1;; |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 163 | esac |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 164 | done |
| 165 | |
Yuli Shlosberg | 3301bec | 2017-11-08 15:31:27 +0200 | [diff] [blame] | 166 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 167 | [ -f /opt/config/env_name.txt ] && DEP_ENV=$(cat /opt/config/env_name.txt) || echo ${DEP_ENV} |
Yuli Shlosberg | 316bb25 | 2017-11-14 11:47:17 +0200 | [diff] [blame] | 168 | [ -f /opt/config/nexus_username.txt ] && NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) || NEXUS_USERNAME=release |
| 169 | [ -f /opt/config/nexus_password.txt ] && NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) || NEXUS_PASSWD=sfWU3DFVdBr7GVxB85mTYgAW |
| 170 | [ -f /opt/config/nexus_docker_repo.txt ] && NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) || NEXUS_DOCKER_REPO=nexus3.onap.org:${PORT} |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 171 | [ -f /opt/config/nexus_username.txt ] && docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO |
| 172 | |
| 173 | |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 174 | cleanup |
| 175 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 176 | |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 177 | export IP=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'` |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 178 | export PREFIX=${NEXUS_DOCKER_REPO}'/onap' |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 179 | |
| 180 | if [ ${LOCAL} = true ]; then |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 181 | PREFIX='onap' |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 182 | fi |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 183 | |
| 184 | echo "" |
| 185 | |
| 186 | # Elastic-Search |
| 187 | echo "docker run sdc-elasticsearch..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 188 | if [ ${LOCAL} = false ]; then |
| 189 | echo "pulling code" |
| 190 | docker pull ${PREFIX}/sdc-elasticsearch:${RELEASE} |
| 191 | fi |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 192 | docker run -dit --name sdc-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --memory 750m --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --env ES_HEAP_SIZE=1024M --volume ${WORKSPACE}/data/ES:/usr/share/elasticsearch/data --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9200:9200 --publish 9300:9300 ${PREFIX}/sdc-elasticsearch:${RELEASE} /bin/sh |
| 193 | |
| 194 | elasticHealthCheck |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 195 | |
Tal Gitelman | 38211c8 | 2018-01-24 17:59:53 +0200 | [diff] [blame] | 196 | # Init-Elastic-Search |
| 197 | echo "docker run sdc-init-elasticsearch..." |
| 198 | if [ ${LOCAL} = false ]; then |
| 199 | echo "pulling code" |
| 200 | docker pull ${PREFIX}/sdc-init-elasticsearch:${RELEASE} |
| 201 | fi |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 202 | docker run --name sdc-init-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --memory 750m --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments ${PREFIX}/sdc-init-elasticsearch:${RELEASE} |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 203 | |
| 204 | # Checking Elastic-Search-Init chef status |
| 205 | if [ ! $? -eq 0 ]; then |
| 206 | echo "Elastic-Search Initialization failed" |
| 207 | exit $? |
| 208 | fi |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 209 | |
Tal Gitelman | 38211c8 | 2018-01-24 17:59:53 +0200 | [diff] [blame] | 210 | # Cassandra |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 211 | echo "docker run sdc-cassandra..." |
| 212 | if [ ${LOCAL} = false ]; then |
| 213 | docker pull ${PREFIX}/sdc-cassandra:${RELEASE} |
| 214 | fi |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 215 | docker run -dit --name sdc-cs --env RELEASE="${RELEASE}" --env CS_PASSWORD="${CS_PASSWORD}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --env JVM_OPTS="-Xms1024m -Xmx1024m" --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 ${WORKSPACE}/data/CS:/var/lib/cassandra --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9042:9042 --publish 9160:9160 ${PREFIX}/sdc-cassandra:${RELEASE} /bin/sh |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 216 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 217 | |
| 218 | echo "please wait while CS is starting..." |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 219 | monitor_docker sdc-cs |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 220 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 221 | |
| 222 | # cassandra-init |
| 223 | echo "docker run sdc-cassandra-init..." |
| 224 | if [ ${LOCAL} = false ]; then |
| 225 | docker pull ${PREFIX}/sdc-cassandra-init:${RELEASE} |
| 226 | fi |
| 227 | docker run --name sdc-cs-init --env RELEASE="${RELEASE}" --env SDC_USER="${SDC_USER}" --env SDC_PASSWORD="${SDC_PASSWORD}" --env CS_PASSWORD="${CS_PASSWORD}" --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 ${WORKSPACE}/data/CS:/var/lib/cassandra --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --volume ${WORKSPACE}/data/CS-Init:/root/chef-solo/cache ${PREFIX}/sdc-cassandra-init:${RELEASE} > /dev/null 2>&1 |
| 228 | rc=$? |
| 229 | if [[ $rc != 0 ]]; then exit $rc; fi |
| 230 | |
| 231 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 232 | # kibana |
| 233 | echo "docker run sdc-kibana..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 234 | if [ ${LOCAL} = false ]; then |
| 235 | docker pull ${PREFIX}/sdc-kibana:${RELEASE} |
| 236 | fi |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 237 | 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 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 5601:5601 ${PREFIX}/sdc-kibana:${RELEASE} |
| 238 | |
| 239 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 240 | |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 241 | dir_perms |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 242 | |
| 243 | # Back-End |
| 244 | echo "docker run sdc-backend..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 245 | if [ ${LOCAL} = false ]; then |
| 246 | docker pull ${PREFIX}/sdc-backend:${RELEASE} |
Tal Gitelman | e224d0b | 2017-10-17 15:24:25 +0300 | [diff] [blame] | 247 | else |
Tal Gitelman | 8e5fc51 | 2017-10-23 13:49:06 +0300 | [diff] [blame] | 248 | ADDITIONAL_ARGUMENTS=${DEBUG_PORT} |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 249 | fi |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 250 | 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 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/BE/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8443:8443 --publish 8080:8080 ${ADDITIONAL_ARGUMENTS} ${PREFIX}/sdc-backend:${RELEASE} |
| 251 | |
| 252 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 253 | |
| 254 | echo "please wait while BE is starting..." |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 255 | monitor_docker sdc-BE |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 256 | |
| 257 | |
| 258 | # Front-End |
| 259 | echo "docker run sdc-frontend..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 260 | if [ ${LOCAL} = false ]; then |
| 261 | docker pull ${PREFIX}/sdc-frontend:${RELEASE} |
| 262 | fi |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 263 | 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 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/FE/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9443:9443 --publish 8181:8181 ${PREFIX}/sdc-frontend:${RELEASE} |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 264 | |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 265 | |
| 266 | |
| 267 | echo "please wait while FE is starting....." |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 268 | monitor_docker sdc-FE |
| 269 | |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 270 | # healthCheck |
| 271 | healthCheck |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 272 | |
ml636r | 0649e65 | 2017-02-20 21:10:54 +0200 | [diff] [blame] | 273 | |
Yuli Shlosberg | 9dde926 | 2017-09-12 14:11:48 +0300 | [diff] [blame] | 274 | # sanityDocker |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 275 | if [[ (${RUNTESTS} = true) && (${healthCheck_http_code} == 200) ]]; then |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 276 | echo "docker run sdc-sanity..." |
| 277 | echo "Triger sanity docker, please wait..." |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 278 | |
Yuli Shlosberg | 9dde926 | 2017-09-12 14:11:48 +0300 | [diff] [blame] | 279 | if [ ${LOCAL} = false ]; then |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 280 | docker pull ${PREFIX}/sdc-sanity:${RELEASE} |
Yuli Shlosberg | 9dde926 | 2017-09-12 14:11:48 +0300 | [diff] [blame] | 281 | fi |
Yuli Shlosberg | 316bb25 | 2017-11-14 11:47:17 +0200 | [diff] [blame] | 282 | |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 283 | docker run --detach --name sdc-sanity --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 1500m --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/sdc-sanity/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-sanity/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/logs/sdc-sanity/outputCsar:/var/lib/tests/outputCsar --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9560:9560 ${PREFIX}/sdc-sanity:${RELEASE} |
| 284 | echo "please wait while SANITY is starting....." |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 285 | monitor_docker sdc-sanity |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 286 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 287 | fi |