blob: add9ae17e37e3315ecf7ea1b8a4c890357410678 [file] [log] [blame]
sg481n0b5f6ae2017-09-27 15:05:11 +00001#!/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:
25source ${SCRIPTS}/common_functions.sh
26
27# Clone AAF Authz repo
28mkdir -p $WORKSPACE/archives/aafcsit
29cd $WORKSPACE/archives/aafcsit
30#unset http_proxy https_proxy
31git clone --depth 1 http://gerrit.onap.org/r/aaf/authz -b master
32git pull
Sai Gandham309e5f72018-03-27 19:30:36 +000033cd $WORKSPACE/archives/aafcsit/authz/auth/auth-service/src/main/resources/docker-compose
sg481n0b5f6ae2017-09-27 15:05:11 +000034pwd
Sai Gandham309e5f72018-03-27 19:30:36 +000035chmod -R 777 $WORKSPACE/archives/aafcsit/authz/auth/auth-service/src/main/resources/docker-compose
sg481n0b5f6ae2017-09-27 15:05:11 +000036
37
38# start aaf containers with docker compose and configuration from docker-compose.yml
39docker-compose up -d
Victor Moralesd84582c2018-04-23 16:01:55 -070040export aaf_service=$(get_docker_compose_service aaf_container)
41export cassandra_service=$(get_docker_compose_service cassandra_container)
sg481n0b5f6ae2017-09-27 15:05:11 +000042
Victor Moralesd84582c2018-04-23 16:01:55 -070043# Wait for initialization of Docker container for AAF & Cassandra
Sai Gandham5e2f9c92018-04-10 20:34:45 +000044for i in {1..12}; do
Victor Moralesd84582c2018-04-23 16:01:55 -070045
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) ]
sg481n0b5f6ae2017-09-27 15:05:11 +000049 then
Sai Gandham5e2f9c92018-04-10 20:34:45 +000050 echo "AAF Service Running"
51 break
52 else
53 echo sleep $i
sg481n0b5f6ae2017-09-27 15:05:11 +000054 sleep $i
55 fi
56done
57
58
Victor Moralesd84582c2018-04-23 16:01:55 -070059AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $aaf_service)
60CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $cassandra_service)
sg481n0b5f6ae2017-09-27 15:05:11 +000061
Victor Moralesd84582c2018-04-23 16:01:55 -070062bypass_ip_adress $AAF_IP
63bypass_ip_adress $CASSANDRA_IP
sg481n0b5f6ae2017-09-27 15:05:11 +000064
65echo AAF_IP=${AAF_IP}
66echo CASSANDRA_IP=${CASSANDRA_IP}
67
68
69# Wait for initialization of docker services
Sai Gandham5e2f9c92018-04-10 20:34:45 +000070for i in {1..12}; do
71 curl -sS -m 1 ${AAF_IP}:8101 && break
sg481n0b5f6ae2017-09-27 15:05:11 +000072 echo sleep $i
73 sleep $i
74done
75
76#Pass any variables required by Robot test suites in ROBOT_VARIABLES
Sai Gandham5e2f9c92018-04-10 20:34:45 +000077ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}"