Merge "Move remaining CSITs from to docker/csit"
[policy/docker.git] / csit / drools-applications / plans / setup.sh
1 #!/bin/bash
2 #
3 # ===========LICENSE_START====================================================
4 #  Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
5 # ============================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=====================================================
18 #
19 source ${SCRIPTS}/get-branch-mariadb.sh
20
21 echo "Uninstall docker-py and reinstall docker."
22 pip uninstall -y docker-py
23 pip uninstall -y docker
24 pip install -U docker==2.7.0
25
26 sudo apt-get -y install libxml2-utils
27
28 bash ${SCRIPTS}/get-models-examples.sh
29 source ${SCRIPTS}/detmVers.sh
30
31 docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d drools-apps
32
33 unset http_proxy https_proxy
34
35 DROOLS_IP=`get-instance-ip.sh drools-apps`
36 API_IP=`get-instance-ip.sh policy-api`
37 PAP_IP=`get-instance-ip.sh policy-pap`
38 XACML_IP=`get-instance-ip.sh policy-xacml-pdp`
39 SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
40 export SIM_IP
41
42 echo DROOLS IP IS ${DROOLS_IP}
43 echo API IP IS ${API_IP}
44 echo PAP IP IS ${PAP_IP}
45 echo XACML IP IS ${XACML_IP}
46 echo SIMULATORS IP IS ${SIM_IP}
47
48 # wait for the app to start up
49 ${SCRIPTS}/wait_for_port.sh ${DROOLS_IP} 6969
50
51 # give enough time for the controllers to come up
52 sleep 15
53
54 DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
55 DATA2=${TESTPLANDIR}/tests/data
56
57 ROBOT_VARIABLES=""
58 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCRIPTS}"
59 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
60 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
61 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
62 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}"
63 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}"
64 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}"
65 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}"