blob: c99a031831c4933c858467a82ab9de6e65e9cde5 [file] [log] [blame]
Jim Hahn3486a922021-05-10 15:36:30 -04001#!/bin/bash
2# ============LICENSE_START=======================================================
3# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
adheli.tavares7abe36c2022-02-02 14:53:10 +00004# Modifications Copyright 2021-2022 Nordix Foundation.
Jim Hahn3486a922021-05-10 15:36:30 -04005# ================================================================================
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#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
Jim Hahn3486a922021-05-10 15:36:30 -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 Hahn3486a922021-05-10 15:36:30 -040025
26sudo apt-get -y install libxml2-utils
Jim Hahn3486a922021-05-10 15:36:30 -040027
adheli.tavares7abe36c2022-02-02 14:53:10 +000028source "${SCRIPTS}"/get-versions.sh
29bash "${SCRIPTS}"/get-models-examples.sh
Jim Hahn3486a922021-05-10 15:36:30 -040030
adheli.tavares7abe36c2022-02-02 14:53:10 +000031docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d xacml-pdp
Jim Hahn3486a922021-05-10 15:36:30 -040032
33unset http_proxy https_proxy
34
adheli.tavares7abe36c2022-02-02 14:53:10 +000035POLICY_API_IP=$(get-instance-ip.sh policy-api)
36MARIADB_IP=$(get-instance-ip.sh mariadb)
37POLICY_PDPX_IP=$(get-instance-ip.sh policy-xacml-pdp)
38SIM_IP=$(get-instance-ip.sh simulator)
39POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
Jim Hahn3486a922021-05-10 15:36:30 -040040
Jim Hahnfa066162021-07-12 15:07:33 -040041export SIM_IP
42
adheli.tavares7abe36c2022-02-02 14:53:10 +000043echo PDP IP IS "${POLICY_PDPX_IP}"
44echo API IP IS "${POLICY_API_IP}"
45echo PAP IP IS "${POLICY_PAP_IP}"
46echo MARIADB IP IS "${MARIADB_IP}"
47echo SIM_IP IS "${SIM_IP}"
Jim Hahn3486a922021-05-10 15:36:30 -040048
49# wait for the app to start up
adheli.tavares7abe36c2022-02-02 14:53:10 +000050"${SCRIPTS}"/wait_for_port.sh "${POLICY_PDPX_IP}" 6969
Jim Hahn3486a922021-05-10 15:36:30 -040051
52DATA2=${WORKSPACE}/models/models-examples/src/main/resources/policies
53
54ROBOT_VARIABLES=""
55ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR_DMAAP:${SCRIPTS}"
56ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
57ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PDPX_IP:${POLICY_PDPX_IP}"
58ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
59ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"