blob: 550337e9df7892ededcb453e877c3646178c27a9 [file] [log] [blame]
Chenfei Gaod4c51852019-02-06 20:45:10 -05001#!/bin/bash
2# ============LICENSE_START=======================================================
Jim Hahn09148c82020-09-02 11:16:16 -04003# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
Chenfei Gaod4c51852019-02-06 20:45:10 -05004# ================================================================================
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 +000020# Select branch
21source ${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 +000028
29sudo apt-get -y install libxml2-utils
Jim Hahn00532422020-09-17 17:03:34 -040030bash ${SCRIPTS}/policy/get-models-examples.sh
Jim Hahn09148c82020-09-02 11:16:16 -040031
Jim Hahn00532422020-09-17 17:03:34 -040032source ${SCRIPTS}/policy/detmVers.sh
Jim Hahn09148c82020-09-02 11:16:16 -040033
34DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
35
36# create a couple of variations of the policy definitions
37sed -e 's!Measurement_vGMUX!ADifferentValue!' \
38 ${DATA}/vCPE.policy.monitoring.input.tosca.json \
39 >${DATA}/vCPE.policy.monitoring.input.tosca.v1_2.json
40
41sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \
42 -e 's!"policy-version": 1!"policy-version": 2!' \
43 ${DATA}/vCPE.policy.monitoring.input.tosca.json \
44 >${DATA}/vCPE.policy.monitoring.input.tosca.v2.json
45
Bilal Ad46ab2e2019-06-07 21:25:59 +000046echo ${POLICY_API_VERSION}
Bilal A71e57372019-12-17 02:17:57 +000047
Jim Hahn00532422020-09-17 17:03:34 -040048docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d api
Jim Hahn954af932019-06-03 15:00:08 -040049
Jim Hahn954af932019-06-03 15:00:08 -040050
51unset http_proxy https_proxy
Chenfei Gaod4c51852019-02-06 20:45:10 -050052
53POLICY_API_IP=`get-instance-ip.sh policy-api`
Bilal A95097c22019-04-12 22:38:32 +000054MARIADB_IP=`get-instance-ip.sh mariadb`
55
Chenfei Gaod4c51852019-02-06 20:45:10 -050056echo API IP IS ${POLICY_API_IP}
Bilal A95097c22019-04-12 22:38:32 +000057echo MARIADB IP IS ${MARIADB_IP}
58
Jim Hahn00532422020-09-17 17:03:34 -040059# wait for the app to start up
60${SCRIPTS}/policy/wait_for_port.sh ${POLICY_API_IP} 6969
61
Jim Hahn09148c82020-09-02 11:16:16 -040062ROBOT_VARIABLES=""
63ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
64ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"