blob: a1d153f8425a75dc2542f91ef3cf9195c8f8fc4e [file] [log] [blame]
ramverma9e9f7222019-02-11 16:25:44 +00001#!/bin/bash
2# ============LICENSE_START=======================================================
3# Copyright (C) 2019 Nordix Foundation.
Jim Hahn1ebe7ec2020-04-02 13:32:01 -04004# Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
ramverma9e9f7222019-02-11 16:25:44 +00005# ================================================================================
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=========================================================
20
Bilal Ad46ab2e2019-06-07 21:25:59 +000021source ${SCRIPTS}/policy/config/policy-csit.conf
Bilal Ad46ab2e2019-06-07 21:25:59 +000022
Bilal A95097c22019-04-12 22:38:32 +000023echo "Uninstall docker-py and reinstall docker."
24pip uninstall -y docker-py
25pip uninstall -y docker
26pip install -U docker==2.7.0
27
Bilal Ad46ab2e2019-06-07 21:25:59 +000028sudo apt-get -y install libxml2-utils
Jim Hahn00532422020-09-17 17:03:34 -040029bash ${SCRIPTS}/policy/get-models-examples.sh
Jim Hahn09148c82020-09-02 11:16:16 -040030
Jim Hahn00532422020-09-17 17:03:34 -040031source ${SCRIPTS}/policy/detmVers.sh
Jim Hahn09148c82020-09-02 11:16:16 -040032
Jim Hahn00532422020-09-17 17:03:34 -040033docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d pap
ramverma9e9f7222019-02-11 16:25:44 +000034
Jim Hahn0a594cf2019-04-19 12:47:01 -040035unset http_proxy https_proxy
36
ramverma9e9f7222019-02-11 16:25:44 +000037POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
Jim Hahn0a594cf2019-04-19 12:47:01 -040038POLICY_API_IP=`get-instance-ip.sh policy-api`
Bilal A95097c22019-04-12 22:38:32 +000039MARIADB_IP=`get-instance-ip.sh mariadb`
40
ramverma9e9f7222019-02-11 16:25:44 +000041echo PAP IP IS ${POLICY_PAP_IP}
Jim Hahn0a594cf2019-04-19 12:47:01 -040042echo API IP IS ${POLICY_API_IP}
Bilal A95097c22019-04-12 22:38:32 +000043echo MARIADB IP IS ${MARIADB_IP}
Bilal A95097c22019-04-12 22:38:32 +000044
Jim Hahn00532422020-09-17 17:03:34 -040045
46# wait for the app to start up
47${SCRIPTS}/policy/wait_for_port.sh ${POLICY_PAP_IP} 6969
48
49
50DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
Jim Hahn09148c82020-09-02 11:16:16 -040051
Jim Hahn1ebe7ec2020-04-02 13:32:01 -040052ROBOT_VARIABLES=""
53ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"
54ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
Jim Hahn09148c82020-09-02 11:16:16 -040055ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"