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%^!" |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 6 | JETTY_BASE="/var/lib/jetty" |
Gitelman, Tal (tg851x) | 328388b | 2018-03-22 13:03:44 +0200 | [diff] [blame] | 7 | BE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=4000,server=y,suspend=n -Xmx1536m -Xms1536m" |
| 8 | FE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=6000,server=y,suspend=n -Xmx256m -Xms256m" |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 9 | ONBOARD_BE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=4001,server=y,suspend=n -Xmx1g -Xms1g" |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 10 | SIM_JAVA_OPTIONS=" -Xmx128m -Xms128m -Xss1m" |
| 11 | API_TESTS_JAVA_OPTIONS="-Xmx512m -Xms512m" |
| 12 | UI_TESTS_JAVA_OPTIONS="-Xmx1024m -Xms1024m" |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 13 | #Define this as variable, so it can be excluded in run commands on Docker for OSX, as /etc/localtime cant be mounted there. |
| 14 | LOCAL_TIME_MOUNT_CMD="--volume /etc/localtime:/etc/localtime:ro" |
| 15 | # If os is OSX, unset this, so /etc/localtime is not mounted, otherwise leave it be |
| 16 | if [[ "$OSTYPE" == "darwin"* ]]; then |
| 17 | LOCAL_TIME_MOUNT_CMD="" |
| 18 | fi |
| 19 | |
| 20 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 21 | |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 22 | function usage { |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 23 | 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] | 24 | } |
| 25 | |
| 26 | |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 27 | function cleanup { |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 28 | echo "performing old dockers cleanup" |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 29 | |
| 30 | if [ "$1" == "all" ] ; then |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 31 | docker_ids=`docker ps -a | egrep -v "onap/sdc-simulator" | egrep "ecomp-nexus:${PORT}/sdc|sdc|Exit" | awk '{print $1}'` |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 32 | for X in ${docker_ids} |
| 33 | do |
| 34 | docker rm -f ${X} |
| 35 | done |
| 36 | else |
| 37 | echo "performing $1 docker cleanup" |
| 38 | tmp=`docker ps -a -q --filter="name=$1"` |
Yuli Shlosberg | 474996a | 2018-02-27 18:55:25 +0200 | [diff] [blame] | 39 | if [[ ! -z "$tmp" ]]; then |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 40 | docker rm -f ${tmp} |
| 41 | fi |
| 42 | fi |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 43 | } |
| 44 | |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 45 | #Prefix all dirs with WORKSPACE variable, so it doesn't use absolute path if runnning outside of VM |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 46 | function dir_perms { |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 47 | mkdir -p ${WORKSPACE}/data/logs/BE/SDC/SDC-BE |
| 48 | mkdir -p ${WORKSPACE}/data/logs/FE/SDC/SDC-FE |
| 49 | mkdir -p ${WORKSPACE}/data/logs/sdc-api-tests/ExtentReport |
| 50 | mkdir -p ${WORKSPACE}/data/logs/ONBOARD/SDC/ONBOARD-BE |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 51 | mkdir -p ${WORKSPACE}/data/logs/sdc-api-tests/target |
| 52 | mkdir -p ${WORKSPACE}/data/logs/sdc-ui-tests/ExtentReport |
| 53 | mkdir -p ${WORKSPACE}/data/logs/sdc-ui-tests/target |
Yuli Shlosberg | 23cc7f5 | 2018-02-28 13:19:42 +0200 | [diff] [blame] | 54 | mkdir -p ${WORKSPACE}/data/logs/docker_logs |
Yuli Shlosberg | e2eef60 | 2018-04-10 23:05:13 +0300 | [diff] [blame] | 55 | mkdir -p ${WORKSPACE}/data/logs/WS |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 56 | chmod -R 777 ${WORKSPACE}/data/logs |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 57 | } |
Yuli Shlosberg | 36604c7 | 2018-02-25 16:03:45 +0200 | [diff] [blame] | 58 | |
Yuli Shlosberg | b4deec1 | 2018-02-25 20:24:44 +0200 | [diff] [blame] | 59 | function docker_logs { |
| 60 | |
Yuli Shlosberg | 23cc7f5 | 2018-02-28 13:19:42 +0200 | [diff] [blame] | 61 | docker logs $1 > ${WORKSPACE}/data/logs/docker_logs/$1_docker.log |
Yuli Shlosberg | b4deec1 | 2018-02-25 20:24:44 +0200 | [diff] [blame] | 62 | |
| 63 | } |
| 64 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 65 | function probe_cs { |
Grinberg Moti | c3bda48 | 2017-02-23 11:24:34 +0200 | [diff] [blame] | 66 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 67 | cs_stat=false |
Yuli Shlosberg | 5d0f58e | 2018-02-26 14:18:08 +0200 | [diff] [blame] | 68 | docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1 |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 69 | rc=$? |
| 70 | if [[ $rc == 0 ]]; then |
| 71 | echo DOCKER start finished in $2 seconds |
| 72 | cs_stat=true |
| 73 | fi |
| 74 | |
| 75 | } |
| 76 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 77 | function probe_be { |
| 78 | |
| 79 | be_stat=false |
Yuli Shlosberg | 5d0f58e | 2018-02-26 14:18:08 +0200 | [diff] [blame] | 80 | docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1 |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 81 | rc=$? |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 82 | if [[ $rc == 0 ]]; then |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 83 | echo DOCKER start finished in $2 seconds |
| 84 | be_stat=true |
| 85 | fi |
| 86 | |
| 87 | } |
| 88 | |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 89 | function probe_sdc_onboard_be { |
| 90 | |
| 91 | sdc_onboard_be_stat=false |
| 92 | docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1 |
| 93 | rc=$? |
| 94 | if [[ $rc == 0 ]]; then |
| 95 | echo DOCKER start finished in $2 seconds |
| 96 | sdc_onboard_be_stat=true |
| 97 | fi |
| 98 | |
| 99 | } |
| 100 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 101 | function probe_fe { |
| 102 | |
| 103 | fe_stat=false |
Yuli Shlosberg | 5d0f58e | 2018-02-26 14:18:08 +0200 | [diff] [blame] | 104 | docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1 |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 105 | rc=$? |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 106 | if [[ $rc == 0 ]]; then |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 107 | echo DOCKER start finished in $2 seconds |
| 108 | fe_stat=true |
| 109 | fi |
| 110 | |
| 111 | } |
| 112 | |
| 113 | function probe_es { |
| 114 | |
| 115 | es_stat=false |
Yuli Shlosberg | 474996a | 2018-02-27 18:55:25 +0200 | [diff] [blame] | 116 | health_Check_http_code=$(curl --noproxy "*" -o /dev/null -w '%{http_code}' http://${IP}:9200/_cluster/health?wait_for_status=yellow&timeout=120s) |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 117 | if [[ "$health_Check_http_code" -eq 200 ]] |
| 118 | then |
| 119 | echo DOCKER start finished in $2 seconds |
| 120 | es_stat=true |
| 121 | fi |
| 122 | |
| 123 | } |
| 124 | |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 125 | function probe_sim { |
| 126 | |
| 127 | if lsof -Pi :8285 -sTCP:LISTEN -t >/dev/null ; then |
| 128 | echo "running" |
| 129 | sim_stat=true |
| 130 | else |
| 131 | echo "not running" |
| 132 | sim_stat=false |
| 133 | fi |
| 134 | |
| 135 | |
| 136 | } |
| 137 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 138 | function probe_docker { |
| 139 | |
| 140 | match_result=false |
| 141 | MATCH=`docker logs --tail 30 $1 | grep "DOCKER STARTED"` |
| 142 | echo MATCH is -- $MATCH |
| 143 | |
| 144 | if [ -n "$MATCH" ]; then |
| 145 | echo DOCKER start finished in $2 seconds |
| 146 | match_result=true |
| 147 | fi |
| 148 | } |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 149 | function monitor_docker { |
| 150 | |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 151 | echo monitor $1 Docker |
| 152 | sleep 5 |
| 153 | TIME_OUT=900 |
| 154 | INTERVAL=20 |
| 155 | TIME=0 |
| 156 | while [ "$TIME" -lt "$TIME_OUT" ]; do |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 157 | if [ "$1" == "sdc-cs" ]; then |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 158 | probe_cs $1 $TIME |
| 159 | if [[ $cs_stat == true ]]; then break; fi |
| 160 | elif [ "$1" == "sdc-es" ]; then |
| 161 | probe_es $1 $TIME |
| 162 | if [[ $es_stat == true ]]; then break; fi |
| 163 | elif [ "$1" == "sdc-BE" ]; then |
| 164 | probe_be $1 $TIME |
| 165 | if [[ $be_stat == true ]]; then break; fi |
| 166 | elif [ "$1" == "sdc-FE" ]; then |
| 167 | probe_fe $1 $TIME |
| 168 | if [[ $fe_stat == true ]]; then break; fi |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 169 | elif [ "$1" == "sdc-onboard-BE" ]; then |
| 170 | probe_sdc_onboard_be $1 $TIME |
| 171 | if [[ $sdc_onboard_be_stat == true ]]; then break; fi |
| 172 | |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 173 | else |
| 174 | probe_docker $1 $TIME |
| 175 | if [[ $match_result == true ]]; then break; fi |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 176 | fi |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 177 | echo Sleep: $INTERVAL seconds before testing if $1 DOCKER is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds |
| 178 | sleep $INTERVAL |
| 179 | TIME=$(($TIME+$INTERVAL)) |
| 180 | done |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 181 | |
Yuli Shlosberg | b4deec1 | 2018-02-25 20:24:44 +0200 | [diff] [blame] | 182 | docker_logs $1 |
Yuli Shlosberg | 36604c7 | 2018-02-25 16:03:45 +0200 | [diff] [blame] | 183 | |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 184 | if [ "$TIME" -ge "$TIME_OUT" ]; then |
| 185 | echo -e "\e[1;31mTIME OUT: DOCKER was NOT fully started in $TIME_OUT seconds... Could cause problems ...\e[0m" |
| 186 | fi |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 187 | |
| 188 | } |
| 189 | |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 190 | function healthCheck { |
Yuli Shlosberg | 474996a | 2018-02-27 18:55:25 +0200 | [diff] [blame] | 191 | curl --noproxy "*" ${IP}:9200/_cluster/health?pretty=true |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 192 | |
| 193 | echo "BE health-Check:" |
Yuli Shlosberg | 474996a | 2018-02-27 18:55:25 +0200 | [diff] [blame] | 194 | curl --noproxy "*" http://${IP}:8080/sdc2/rest/healthCheck |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 195 | |
| 196 | echo "" |
| 197 | echo "" |
| 198 | echo "FE health-Check:" |
Yuli Shlosberg | 474996a | 2018-02-27 18:55:25 +0200 | [diff] [blame] | 199 | curl --noproxy "*" http://${IP}:8181/sdc1/rest/healthCheck |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 200 | |
| 201 | |
| 202 | echo "" |
| 203 | echo "" |
Yuli Shlosberg | 474996a | 2018-02-27 18:55:25 +0200 | [diff] [blame] | 204 | healthCheck_http_code=$(curl --noproxy "*" -o /dev/null -w '%{http_code}' -H "Accept: application/json" -H "Content-Type: application/json" -H "USER_ID: jh0003" http://${IP}:8080/sdc2/rest/v1/user/demo;) |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 205 | if [[ ${healthCheck_http_code} != 200 ]] |
| 206 | then |
| 207 | echo "Error [${healthCheck_http_code}] while user existance check" |
| 208 | return ${healthCheck_http_code} |
| 209 | fi |
| 210 | echo "check user existance: OK" |
| 211 | return ${healthCheck_http_code} |
| 212 | } |
| 213 | |
Grinberg Moti | 9724621 | 2017-02-21 19:30:31 +0200 | [diff] [blame] | 214 | RELEASE=latest |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 215 | LOCAL=false |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 216 | RUNTESTS=false |
Tal Gitelman | 8e5fc51 | 2017-10-23 13:49:06 +0300 | [diff] [blame] | 217 | DEBUG_PORT="--publish 4000:4000" |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 218 | ONBOARD_DEBUG_PORT="--publish 4001:4000" |
Tal Gitelman | e224d0b | 2017-10-17 15:24:25 +0300 | [diff] [blame] | 219 | |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 220 | while [ $# -gt 0 ]; do |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 221 | case $1 in |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 222 | # -r | --release - The specific docker version to pull and deploy |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 223 | -r | --release ) |
| 224 | shift 1 ; |
| 225 | RELEASE=$1; |
| 226 | shift 1;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 227 | # -e | --environment - The environment name you want to deploy |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 228 | -e | --environment ) |
| 229 | shift 1; |
| 230 | DEP_ENV=$1; |
| 231 | shift 1 ;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 232 | # -p | --port - The port from which to connect to the docker nexus |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 233 | -p | --port ) |
| 234 | shift 1 ; |
| 235 | PORT=$1; |
| 236 | shift 1 ;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 237 | # -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] | 238 | -l | --local ) |
| 239 | LOCAL=true; |
| 240 | shift 1;; |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 241 | # -ta - Use this for running the APIs sanity docker after all other dockers have been deployed |
| 242 | -ta ) |
| 243 | shift 1 ; |
| 244 | API_SUITE=$1; |
| 245 | RUN_API_TESTS=true; |
| 246 | shift 1 ;; |
| 247 | # -tu - Use this for running the UI sanity docker after all other dockers have been deployed |
| 248 | -tu ) |
| 249 | shift 1 ; |
| 250 | UI_SUITE=$1; |
| 251 | RUN_UI_TESTS=true; |
| 252 | shift 1 ;; |
| 253 | # -tad - Use this for running the DEFAULT suite of tests in APIs sanity docker after all other dockers have been deployed |
| 254 | -tad | -t ) |
| 255 | API_SUITE="onapApiSanity"; |
| 256 | RUN_API_TESTS=true; |
| 257 | shift 1 ;; |
| 258 | # -tud - Use this for running the DEFAULT suite of tests in UI sanity docker after all other dockers have been deployed |
| 259 | -tud ) |
| 260 | UI_SUITE="onapUiSanity"; |
| 261 | RUN_UI_TESTS=true; |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 262 | shift 1 ;; |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 263 | # -d | --docker - The init specified docker |
| 264 | -d | --docker ) |
| 265 | shift 1 ; |
| 266 | DOCKER=$1; |
| 267 | shift 1 ;; |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 268 | # -h | --help - Display the help message with all the available run options |
Yuli Shlosberg | 0566f58 | 2017-11-26 19:05:23 +0200 | [diff] [blame] | 269 | -h | --help ) |
| 270 | usage; |
| 271 | exit 0;; |
| 272 | * ) |
| 273 | usage; |
| 274 | exit 1;; |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 275 | esac |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 276 | done |
| 277 | |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 278 | #Prefix those with WORKSPACE so it can be set to something other then /opt |
| 279 | [ -f ${WORKSPACE}/opt/config/env_name.txt ] && DEP_ENV=$(cat ${WORKSPACE}/opt/config/env_name.txt) || echo ${DEP_ENV} |
| 280 | [ -f ${WORKSPACE}/opt/config/nexus_username.txt ] && NEXUS_USERNAME=$(cat ${WORKSPACE}/opt/config/nexus_username.txt) || NEXUS_USERNAME=release |
| 281 | [ -f ${WORKSPACE}/opt/config/nexus_password.txt ] && NEXUS_PASSWD=$(cat ${WORKSPACE}/opt/config/nexus_password.txt) || NEXUS_PASSWD=sfWU3DFVdBr7GVxB85mTYgAW |
| 282 | [ -f ${WORKSPACE}/opt/config/nexus_docker_repo.txt ] && NEXUS_DOCKER_REPO=$(cat ${WORKSPACE}/opt/config/nexus_docker_repo.txt) || NEXUS_DOCKER_REPO=nexus3.onap.org:${PORT} |
| 283 | [ -f ${WORKSPACE}/opt/config/nexus_username.txt ] && docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 284 | |
Yuli Shlosberg | d1bb2e5 | 2018-01-15 11:51:21 +0200 | [diff] [blame] | 285 | export IP=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'` |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 286 | #If OSX, then use this to get IP |
| 287 | if [[ "$OSTYPE" == "darwin"* ]]; then |
| 288 | export IP=$(ipconfig getifaddr en0) |
| 289 | fi |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 290 | export PREFIX=${NEXUS_DOCKER_REPO}'/onap' |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 291 | |
| 292 | if [ ${LOCAL} = true ]; then |
Idan Amit | db3d554 | 2017-12-07 11:33:32 +0200 | [diff] [blame] | 293 | PREFIX='onap' |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 294 | fi |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 295 | |
| 296 | echo "" |
| 297 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 298 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 299 | #Elastic-Search |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 300 | function sdc-es { |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 301 | echo "docker run sdc-elasticsearch..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 302 | if [ ${LOCAL} = false ]; then |
| 303 | echo "pulling code" |
| 304 | docker pull ${PREFIX}/sdc-elasticsearch:${RELEASE} |
| 305 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 306 | docker run -dit --name sdc-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --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 |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 307 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 308 | echo "please wait while ES is starting..." |
| 309 | monitor_docker sdc-es |
| 310 | } |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 311 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 312 | |
| 313 | #Init-Elastic-Search |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 314 | function sdc-init-es { |
Tal Gitelman | 38211c8 | 2018-01-24 17:59:53 +0200 | [diff] [blame] | 315 | echo "docker run sdc-init-elasticsearch..." |
| 316 | if [ ${LOCAL} = false ]; then |
| 317 | echo "pulling code" |
| 318 | docker pull ${PREFIX}/sdc-init-elasticsearch:${RELEASE} |
| 319 | fi |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 320 | echo "Running sdc-init-es" |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 321 | docker run --name sdc-init-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments ${PREFIX}/sdc-init-elasticsearch:${RELEASE} > /dev/null 2>&1 |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 322 | rc=$? |
Yuli Shlosberg | b4deec1 | 2018-02-25 20:24:44 +0200 | [diff] [blame] | 323 | docker_logs sdc-init-es |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 324 | if [[ $rc != 0 ]]; then exit $rc; fi |
Tal Gitelman | f192759 | 2018-01-29 17:24:56 +0200 | [diff] [blame] | 325 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 326 | } |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 327 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 328 | #Cassandra |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 329 | function sdc-cs { |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 330 | echo "docker run sdc-cassandra..." |
| 331 | if [ ${LOCAL} = false ]; then |
| 332 | docker pull ${PREFIX}/sdc-cassandra:${RELEASE} |
| 333 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 334 | docker run -dit --name sdc-cs --env RELEASE="${RELEASE}" --env CS_PASSWORD="${CS_PASSWORD}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --env MAX_HEAP_SIZE="1536M" --env HEAP_NEWSIZE="512M" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --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] | 335 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 336 | |
| 337 | echo "please wait while CS is starting..." |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 338 | monitor_docker sdc-cs |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 339 | } |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 340 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 341 | #Cassandra-init |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 342 | function sdc-cs-init { |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 343 | echo "docker run sdc-cassandra-init..." |
| 344 | if [ ${LOCAL} = false ]; then |
| 345 | docker pull ${PREFIX}/sdc-cassandra-init:${RELEASE} |
| 346 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 347 | 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 $LOCAL_TIME_MOUNT_CMD --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 |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 348 | rc=$? |
Yuli Shlosberg | b4deec1 | 2018-02-25 20:24:44 +0200 | [diff] [blame] | 349 | docker_logs sdc-cs-init |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 350 | if [[ $rc != 0 ]]; then exit $rc; fi |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 351 | } |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 352 | |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 353 | #Onboard Cassandra-init |
| 354 | function sdc-cs-onboard-init { |
| 355 | echo "docker run sdc-cs-onboard-init..." |
| 356 | if [ ${LOCAL} = false ]; then |
| 357 | docker pull ${PREFIX}/sdc-onboard-cassandra-init:${RELEASE} |
| 358 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 359 | docker run --name sdc-cs-onboard-init --env RELEASE="${RELEASE}" --env CS_HOST_IP=${IP} --env SDC_USER="${SDC_USER}" --env SDC_PASSWORD="${SDC_PASSWORD}" --env CS_PASSWORD="${CS_PASSWORD}" --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --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-onboard-cassandra-init:${RELEASE} |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 360 | rc=$? |
| 361 | docker_logs sdc-onboard-cs-init |
| 362 | if [[ $rc != 0 ]]; then exit $rc; fi |
| 363 | } |
| 364 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 365 | #Kibana |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 366 | function sdc-kbn { |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 367 | echo "docker run sdc-kibana..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 368 | if [ ${LOCAL} = false ]; then |
| 369 | docker pull ${PREFIX}/sdc-kibana:${RELEASE} |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 370 | docker run --detach --name sdc-kbn --env ENVNAME="${DEP_ENV}" --env NODE_OPTIONS="--max-old-space-size=200" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 5601:5601 ${PREFIX}/sdc-kibana:${RELEASE} |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 371 | fi |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 372 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 373 | } |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 374 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 375 | #Back-End |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 376 | function sdc-BE { |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 377 | echo "docker run sdc-backend..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 378 | if [ ${LOCAL} = false ]; then |
| 379 | docker pull ${PREFIX}/sdc-backend:${RELEASE} |
Tal Gitelman | e224d0b | 2017-10-17 15:24:25 +0300 | [diff] [blame] | 380 | else |
Tal Gitelman | 8e5fc51 | 2017-10-23 13:49:06 +0300 | [diff] [blame] | 381 | ADDITIONAL_ARGUMENTS=${DEBUG_PORT} |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 382 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 383 | docker run --detach --name sdc-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env cassandra_ssl_enabled="false" --env JAVA_OPTIONS="${BE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --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} |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 384 | |
| 385 | echo "please wait while BE is starting..." |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 386 | monitor_docker sdc-BE |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 387 | } |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 388 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 389 | # Back-End-Init |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 390 | function sdc-BE-init { |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 391 | echo "docker run sdc-backend-init..." |
| 392 | if [ ${LOCAL} = false ]; then |
| 393 | docker pull ${PREFIX}/sdc-backend-init:${RELEASE} |
| 394 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 395 | docker run --name sdc-BE-init --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 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/logs/BE/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments ${PREFIX}/sdc-backend-init:${RELEASE} > /dev/null 2>&1 |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 396 | rc=$? |
Yuli Shlosberg | b4deec1 | 2018-02-25 20:24:44 +0200 | [diff] [blame] | 397 | docker_logs sdc-BE-init |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 398 | if [[ $rc != 0 ]]; then exit $rc; fi |
| 399 | } |
| 400 | |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 401 | # Onboard Back-End |
| 402 | function sdc-onboard-BE { |
| 403 | |
| 404 | dir_perms |
| 405 | # Back-End |
| 406 | echo "docker run sdc-onboard-BE ..." |
| 407 | if [ ${LOCAL} = false ]; then |
| 408 | docker pull ${PREFIX}/sdc-onboard-backend:${RELEASE} |
| 409 | else |
| 410 | ADDITIONAL_ARGUMENTS=${ONBOARD_DEBUG_PORT} |
| 411 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 412 | docker run --detach --name sdc-onboard-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env cassandra_ssl_enabled="false" --env SDC_CLUSTER_NAME="SDC-CS-${DEP_ENV}" --env SDC_USER="${SDC_USER}" --env SDC_PASSWORD="${SDC_PASSWORD}" --env JAVA_OPTIONS="${ONBOARD_BE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/logs/ONBOARD:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8445:8445 --publish 8081:8081 ${ADDITIONAL_ARGUMENTS} ${PREFIX}/sdc-onboard-backend:${RELEASE} |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 413 | |
| 414 | echo "please wait while sdc-onboard-BE is starting..." |
| 415 | monitor_docker sdc-onboard-BE |
| 416 | } |
| 417 | |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 418 | |
| 419 | # Front-End |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 420 | function sdc-FE { |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 421 | echo "docker run sdc-frontend..." |
Idan Amit | c7f57ec | 2017-08-31 14:26:21 +0300 | [diff] [blame] | 422 | if [ ${LOCAL} = false ]; then |
| 423 | docker pull ${PREFIX}/sdc-frontend:${RELEASE} |
| 424 | fi |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 425 | docker run --detach --name sdc-FE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${FE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --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} |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 426 | |
| 427 | echo "please wait while FE is starting....." |
Yuli Shlosberg | 5571a86 | 2017-10-03 18:18:51 +0300 | [diff] [blame] | 428 | monitor_docker sdc-FE |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 429 | } |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 430 | |
ml636r | 0649e65 | 2017-02-20 21:10:54 +0200 | [diff] [blame] | 431 | |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 432 | # apis-sanity |
| 433 | function sdc-api-tests { |
| 434 | healthCheck |
| 435 | if [[ (${RUN_API_TESTS} = true) && (${healthCheck_http_code} == 200) ]]; then |
| 436 | echo "docker run sdc-api-tests..." |
| 437 | echo "Triger sdc-api-tests docker, please wait..." |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 438 | |
Yuli Shlosberg | 9dde926 | 2017-09-12 14:11:48 +0300 | [diff] [blame] | 439 | if [ ${LOCAL} = false ]; then |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 440 | docker pull ${PREFIX}/sdc-api-tests:${RELEASE} |
Yuli Shlosberg | 9dde926 | 2017-09-12 14:11:48 +0300 | [diff] [blame] | 441 | fi |
Yuli Shlosberg | 316bb25 | 2017-11-14 11:47:17 +0200 | [diff] [blame] | 442 | |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 443 | docker run --detach --name sdc-api-tests --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${API_TESTS_JAVA_OPTIONS}" --env SUITE_NAME=${API_SUITE} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/logs/sdc-api-tests/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-api-tests/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/logs/sdc-api-tests/outputCsar:/var/lib/tests/outputCsar --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9560:9560 ${PREFIX}/sdc-api-tests:${RELEASE} echo "please wait while SDC-API-TESTS is starting....." |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 444 | monitor_docker sdc-api-tests |
| 445 | |
| 446 | fi |
| 447 | } |
| 448 | |
| 449 | # ui-sanity |
| 450 | function sdc-ui-tests { |
| 451 | healthCheck |
| 452 | if [[ (${RUN_UI_TESTS} = true) && (${healthCheck_http_code} == 200) ]]; then |
| 453 | echo "docker run sdc-ui-tets..." |
| 454 | echo "Triger sdc-ui-tests docker, please wait..." |
| 455 | |
| 456 | if [ ${LOCAL} = false ]; then |
| 457 | docker pull ${PREFIX}/sdc-ui-tests:${RELEASE} |
| 458 | fi |
| 459 | |
| 460 | sdc-sim |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 461 | docker run --detach --name sdc-ui-tests --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${UI_TESTS_JAVA_OPTIONS}" --env SUITE_NAME=${UI_SUITE} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/logs/sdc-ui-tests/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-ui-tests/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 5901:5901 --publish 6901:6901 ${PREFIX}/sdc-ui-tests:${RELEASE} |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 462 | echo "please wait while SDC-UI-TESTS is starting....." |
| 463 | monitor_docker sdc-ui-tests |
| 464 | |
| 465 | fi |
| 466 | } |
| 467 | |
| 468 | |
| 469 | # SDC-Simulator |
| 470 | function sdc-sim { |
| 471 | echo "docker run sdc-webSimulator..." |
| 472 | if [ ${LOCAL} = false ]; then |
Yuli Shlosberg | 98369b1 | 2018-04-10 19:36:24 +0300 | [diff] [blame] | 473 | docker pull ${PREFIX}/sdc-simulator:${RELEASE} |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 474 | fi |
| 475 | |
| 476 | probe_sim |
| 477 | if [ sim_stat=false ]; then |
| 478 | |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 479 | docker run --detach --name sdc-sim --env JAVA_OPTIONS="${SIM_JAVA_OPTIONS}" --env ENVNAME="${DEP_ENV}" $LOCAL_TIME_MOUNT_CMD --volume ${WORKSPACE}/data/logs/WS/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8285:8080 --publish 8286:8443 ${PREFIX}/sdc-simulator:${RELEASE} |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 480 | echo "please wait while SDC-WEB-SIMULATOR is starting....." |
| 481 | monitor_docker sdc-sim |
Yuli Shlosberg | 137cf5c | 2018-01-15 17:32:30 +0200 | [diff] [blame] | 482 | |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 483 | fi |
| 484 | } |
| 485 | |
| 486 | if [ -z "${DOCKER}" ]; then |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 487 | cleanup all |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 488 | dir_perms |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 489 | sdc-es |
| 490 | sdc-init-es |
| 491 | sdc-cs |
| 492 | sdc-cs-init |
Gitelman, Tal (tg851x) | 19c9bda | 2018-03-19 19:07:30 +0200 | [diff] [blame] | 493 | # sdc-kbn |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 494 | sdc-cs-onboard-init |
| 495 | sdc-onboard-BE |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 496 | sdc-BE |
| 497 | sdc-BE-init |
| 498 | sdc-FE |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 499 | healthCheck |
Yuli Shlosberg | f59a225 | 2018-03-21 11:14:08 +0200 | [diff] [blame] | 500 | sdc-api-tests |
dekstroza | 8352006 | 2018-05-03 16:47:08 +0100 | [diff] [blame] | 501 | sdc-ui-tests |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 502 | else |
| 503 | cleanup ${DOCKER} |
svishnev | 0b698c4 | 2018-03-08 15:50:44 +0200 | [diff] [blame] | 504 | dir_perms |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 505 | ${DOCKER} |
Yuli Shlosberg | e07a516 | 2018-02-26 10:11:10 +0200 | [diff] [blame] | 506 | healthCheck |
Yuli Shlosberg | 958c32d | 2018-02-15 12:04:46 +0200 | [diff] [blame] | 507 | fi |