sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # ============LICENSE_START======================================================= |
| 4 | # ONAP AAF |
| 5 | # ================================================================================ |
| 6 | # Copyright (C) 2017 AT&T Intellectual Property. All rights |
| 7 | # reserved. |
| 8 | # ================================================================================ |
| 9 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | # you may not use this file except in compliance with the License. |
| 11 | # You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, software |
| 16 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | # See the License for the specific language governing permissions and |
| 19 | # limitations under the License. |
| 20 | # ============LICENSE_END============================================ |
| 21 | # =================================================================== |
| 22 | # ECOMP is a trademark and service mark of AT&T Intellectual Property. |
| 23 | # |
| 24 | # Place the scripts in run order: |
| 25 | source ${SCRIPTS}/common_functions.sh |
| 26 | |
| 27 | # Clone AAF Authz repo |
| 28 | mkdir -p $WORKSPACE/archives/aafcsit |
| 29 | cd $WORKSPACE/archives/aafcsit |
| 30 | #unset http_proxy https_proxy |
| 31 | git clone --depth 1 http://gerrit.onap.org/r/aaf/authz -b master |
| 32 | git pull |
| 33 | cd $WORKSPACE/archives/aafcsit/authz/authz-service/src/main/resources/docker-compose |
| 34 | pwd |
| 35 | chmod -R 777 $WORKSPACE/archives/aafcsit/authz/authz-service/src/main/resources/docker-compose |
| 36 | |
| 37 | |
| 38 | # start aaf containers with docker compose and configuration from docker-compose.yml |
| 39 | docker-compose up -d |
| 40 | |
| 41 | # Wait for initialization of Docker contaienr for AAF & Cassandra |
| 42 | for i in {1..50}; do |
| 43 | if [ $(docker inspect --format '{{ .State.Running }}' dockercompose_aaf_container_1) ] && \ |
| 44 | [ $(docker inspect --format '{{ .State.Running }}' dockercompose_cassandra_container_1) ] && \ |
| 45 | [ $(docker inspect --format '{{ .State.Running }}' dockercompose_aaf_container_1) ] |
| 46 | then |
| 47 | echo "AAF Service Running" |
| 48 | break |
| 49 | else |
| 50 | echo sleep $i |
| 51 | sleep $i |
| 52 | fi |
| 53 | done |
| 54 | |
| 55 | |
| 56 | AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_aaf_container_1) |
| 57 | CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_cassandra_container_1) |
| 58 | |
| 59 | |
| 60 | echo AAF_IP=${AAF_IP} |
| 61 | echo CASSANDRA_IP=${CASSANDRA_IP} |
| 62 | |
| 63 | |
| 64 | # Wait for initialization of docker services |
| 65 | for i in {1..50}; do |
| 66 | curl -sS -m 1 ${AAF_IP}:8101 && break |
| 67 | echo sleep $i |
| 68 | sleep $i |
| 69 | done |
| 70 | |
| 71 | #Pass any variables required by Robot test suites in ROBOT_VARIABLES |
| 72 | ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}" |