blob: 6ca073bc24a39b6a68e903e8c25558dba110ce0a [file] [log] [blame]
Jim Hahnb3a962f2021-05-12 11:33:43 -04001#!/bin/bash
2#
3# ===========LICENSE_START====================================================
4# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
adheli.tavares7abe36c2022-02-02 14:53:10 +00005# Modifications Copyright 2021-2022 Nordix Foundation.
Jim Hahnb3a962f2021-05-12 11:33:43 -04006# ============================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END=====================================================
19#
Jim Hahnb3a962f2021-05-12 11:33:43 -040020
21echo "Uninstall docker-py and reinstall docker."
Jim Hahnfe3e91c2021-06-04 13:22:49 -040022python3 -m pip uninstall -y docker-py
23python3 -m pip uninstall -y docker
24python3 -m pip install -U docker
Jim Hahnb3a962f2021-05-12 11:33:43 -040025
26sudo apt-get -y install libxml2-utils
27
adheli.tavares7abe36c2022-02-02 14:53:10 +000028source "${SCRIPTS}"/get-versions.sh
29bash "${SCRIPTS}"/get-models-examples.sh
Jim Hahnb3a962f2021-05-12 11:33:43 -040030
adheli.tavares7abe36c2022-02-02 14:53:10 +000031docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools-apps
Jim Hahnb3a962f2021-05-12 11:33:43 -040032
33unset http_proxy https_proxy
34
adheli.tavares7abe36c2022-02-02 14:53:10 +000035DROOLS_IP=$(get-instance-ip.sh drools-apps)
36API_IP=$(get-instance-ip.sh policy-api)
37PAP_IP=$(get-instance-ip.sh policy-pap)
38XACML_IP=$(get-instance-ip.sh policy-xacml-pdp)
39SIM_IP=$(get-instance-ip.sh simulator)
Jim Hahnb3a962f2021-05-12 11:33:43 -040040export SIM_IP
41
adheli.tavares7abe36c2022-02-02 14:53:10 +000042echo DROOLS IP IS "${DROOLS_IP}"
43echo API IP IS "${API_IP}"
44echo PAP IP IS "${PAP_IP}"
45echo XACML IP IS "${XACML_IP}"
46echo SIMULATORS IP IS "${SIM_IP}"
Jim Hahnb3a962f2021-05-12 11:33:43 -040047
48# wait for the app to start up
adheli.tavares7abe36c2022-02-02 14:53:10 +000049"${SCRIPTS}"/wait_for_port.sh "${DROOLS_IP}" 6969
Jim Hahnb3a962f2021-05-12 11:33:43 -040050
51# give enough time for the controllers to come up
52sleep 15
53
54DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
55DATA2=${TESTPLANDIR}/tests/data
56
57ROBOT_VARIABLES=""
58ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCRIPTS}"
59ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
60ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
61ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
62ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}"
63ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}"
64ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}"
65ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}"