blob: faf256fab0ac1ab584c99cd3ca7c0019b4536b3b [file] [log] [blame]
Michael Mokry88f4d472019-03-04 12:00:05 -06001#!/bin/bash
2# ============LICENSE_START=======================================================
Bilal A9f54c002020-01-16 16:12:19 +00003# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
Michael Mokry88f4d472019-03-04 12:00:05 -06004# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19
Bilal Ad46ab2e2019-06-07 21:25:59 +000020source ${SCRIPTS}/policy/config/policy-csit.conf
21export POLICY_MARIADB_VER
22echo ${GERRIT_BRANCH}
23echo ${POLICY_MARIADB_VER}
24
Michael Mokryb4f69622019-05-13 13:09:17 -050025echo "Uninstall docker-py and reinstall docker."
26pip uninstall -y docker-py
27pip uninstall -y docker
28pip install -U docker==2.7.0
29
30# the directory of the script
31DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
32echo ${DIR}
33
34# the temp directory used, within $DIR
35# omit the -p parameter to create a temporal directory in the default location
36WORK_DIR=`mktemp -d -p "$DIR"`
37echo ${WORK_DIR}
38
39cd ${WORK_DIR}
40
41# check if tmp dir was created
42if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
43 echo "Could not create temp dir"
44 exit 1
45fi
46
Bilal Ad46ab2e2019-06-07 21:25:59 +000047sudo apt-get -y install libxml2-utils
Bilal A9f54c002020-01-16 16:12:19 +000048bash ${SCRIPTS}/policy/policy-models-dmaap-sim.sh
49
Bilal A71e57372019-12-17 02:17:57 +000050POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
51export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
52POLICY_PAP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
53export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
54POLICY_XACML_PDP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/xacml-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
55export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
Bilal Ad46ab2e2019-06-07 21:25:59 +000056
57echo ${POLICY_API_VERSION}
58echo ${POLICY_PAP_VERSION}
59echo ${POLICY_XACML_PDP_VERSION}
Bilal A9f54c002020-01-16 16:12:19 +000060
Michael Mokryb4f69622019-05-13 13:09:17 -050061# Adding this waiting container due to race condition between pap and mariadb
62docker-compose -f ${WORKSPACE}/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml run --rm start_dependencies
Jim Hahn954af932019-06-03 15:00:08 -040063
Jim Hahn954af932019-06-03 15:00:08 -040064# now bring everything else up
65docker-compose -f ${WORKSPACE}/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml run --rm start_all
Michael Mokryb4f69622019-05-13 13:09:17 -050066
67unset http_proxy https_proxy
68
69POLICY_API_IP=`get-instance-ip.sh policy-api`
70MARIADB_IP=`get-instance-ip.sh mariadb`
Michael Mokry88f4d472019-03-04 12:00:05 -060071POLICY_PDPX_IP=`get-instance-ip.sh policy-xacml-pdp`
Michael Mokryb4f69622019-05-13 13:09:17 -050072DMAAP_IP=`get-instance-ip.sh dmaap-simulator`
73POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
74
Michael Mokryb4f69622019-05-13 13:09:17 -050075echo PDP IP IS ${POLICY_PDPX_IP}
76echo API IP IS ${POLICY_API_IP}
77echo PAP IP IS ${POLICY_PAP_IP}
78echo MARIADB IP IS ${MARIADB_IP}
79echo DMAAP_IP IS ${DMAAP_IP}
80
Jim Hahn514799f2020-04-20 12:05:50 -040081DATA2=${WORKSPACE}/dmaap-sim/models/models-examples/src/main/resources/policies
82
83ROBOT_VARIABLES=""
84ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
85ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PDPX_IP:${POLICY_PDPX_IP}"
86ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
87ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"