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 |
Sai Gandham | 309e5f7 | 2018-03-27 19:30:36 +0000 | [diff] [blame] | 33 | cd $WORKSPACE/archives/aafcsit/authz/auth/auth-service/src/main/resources/docker-compose |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 34 | pwd |
Sai Gandham | 309e5f7 | 2018-03-27 19:30:36 +0000 | [diff] [blame] | 35 | chmod -R 777 $WORKSPACE/archives/aafcsit/authz/auth/auth-service/src/main/resources/docker-compose |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 36 | |
| 37 | |
| 38 | # start aaf containers with docker compose and configuration from docker-compose.yml |
| 39 | docker-compose up -d |
Victor Morales | d84582c | 2018-04-23 16:01:55 -0700 | [diff] [blame] | 40 | export aaf_service=$(get_docker_compose_service aaf_container) |
| 41 | export cassandra_service=$(get_docker_compose_service cassandra_container) |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 42 | |
Victor Morales | d84582c | 2018-04-23 16:01:55 -0700 | [diff] [blame] | 43 | # Wait for initialization of Docker container for AAF & Cassandra |
Sai Gandham | 5e2f9c9 | 2018-04-10 20:34:45 +0000 | [diff] [blame] | 44 | for i in {1..12}; do |
Victor Morales | d84582c | 2018-04-23 16:01:55 -0700 | [diff] [blame] | 45 | |
| 46 | if [ $(docker inspect --format '{{ .State.Running }}' $aaf_service) ] && \ |
| 47 | [ $(docker inspect --format '{{ .State.Running }}' $cassandra_service) ] && \ |
| 48 | [ $(docker inspect --format '{{ .State.Running }}' $aaf_service) ] |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 49 | then |
Sai Gandham | 5e2f9c9 | 2018-04-10 20:34:45 +0000 | [diff] [blame] | 50 | echo "AAF Service Running" |
| 51 | break |
| 52 | else |
| 53 | echo sleep $i |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 54 | sleep $i |
| 55 | fi |
| 56 | done |
| 57 | |
| 58 | |
Victor Morales | d84582c | 2018-04-23 16:01:55 -0700 | [diff] [blame] | 59 | AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $aaf_service) |
| 60 | CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $cassandra_service) |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 61 | |
Victor Morales | d84582c | 2018-04-23 16:01:55 -0700 | [diff] [blame] | 62 | bypass_ip_adress $AAF_IP |
| 63 | bypass_ip_adress $CASSANDRA_IP |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 64 | |
| 65 | echo AAF_IP=${AAF_IP} |
| 66 | echo CASSANDRA_IP=${CASSANDRA_IP} |
| 67 | |
| 68 | |
| 69 | # Wait for initialization of docker services |
Sai Gandham | 5e2f9c9 | 2018-04-10 20:34:45 +0000 | [diff] [blame] | 70 | for i in {1..12}; do |
| 71 | curl -sS -m 1 ${AAF_IP}:8101 && break |
sg481n | 0b5f6ae | 2017-09-27 15:05:11 +0000 | [diff] [blame] | 72 | echo sleep $i |
| 73 | sleep $i |
| 74 | done |
| 75 | |
| 76 | #Pass any variables required by Robot test suites in ROBOT_VARIABLES |
Sai Gandham | 5e2f9c9 | 2018-04-10 20:34:45 +0000 | [diff] [blame] | 77 | ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}" |