blob: 99b0015c8750b133218e00b8f1f91c5c9a39207b [file] [log] [blame]
pdragosh3f9a0962019-04-16 13:19:45 -04001#!/bin/bash
Jim Hahn426ddc12020-04-14 15:19:53 -04002#
3# ===========LICENSE_START====================================================
a.sreekumar20705742020-02-14 12:03:33 +00004# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
Jim Hahn426ddc12020-04-14 15:19:53 -04005# ============================================================================
pdragosh3f9a0962019-04-16 13:19:45 -04006# 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.
Jim Hahn426ddc12020-04-14 15:19:53 -040017# ============LICENSE_END=====================================================
pdragosh3f9a0962019-04-16 13:19:45 -040018#
a.sreekumar20705742020-02-14 12:03:33 +000019
20# OS upgrades
21
Bilal Ad46ab2e2019-06-07 21:25:59 +000022source ${SCRIPTS}/policy/config/policy-csit.conf
23export POLICY_MARIADB_VER
24echo ${GERRIT_BRANCH}
25echo ${POLICY_MARIADB_VER}
pdragosh3f9a0962019-04-16 13:19:45 -040026
Jim Hahn426ddc12020-04-14 15:19:53 -040027SCR2=${WORKSPACE}/scripts/policy/drools-apps
28
pdragosh3f9a0962019-04-16 13:19:45 -040029echo "Uninstall docker-py and reinstall docker."
30pip uninstall -y docker-py
31pip uninstall -y docker
32pip install -U docker==2.7.0
33
Bilal Ad46ab2e2019-06-07 21:25:59 +000034sudo apt-get -y install libxml2-utils
Jim Hahn426ddc12020-04-14 15:19:53 -040035${SCRIPTS}/policy/policy-models-simulators.sh
36
37POLICY_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()' -)"
38export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
Bilal A71e57372019-12-17 02:17:57 +000039POLICY_DROOLS_APPS_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/drools-applications/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
40echo ${POLICY_DROOLS_APPS_VERSION_EXTRACT}
41export POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
Jim Hahn426ddc12020-04-14 15:19:53 -040042
43echo ${POLICY_XACML_PDP_VERSION}
Bilal A71e57372019-12-17 02:17:57 +000044echo ${POLICY_DROOLS_APPS_VERSION}
Bilal Ad46ab2e2019-06-07 21:25:59 +000045
a.sreekumar20705742020-02-14 12:03:33 +000046echo "user information: $(id)"
47echo "docker and docker-compose versions:"
48docker -v && docker-compose -v
pdragosh3f9a0962019-04-16 13:19:45 -040049
Jim Hahn426ddc12020-04-14 15:19:53 -040050# Adding this waiting container due to race condition between drools and mariadb
51docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_dependencies
pdragosh3f9a0962019-04-16 13:19:45 -040052
Jim Hahn426ddc12020-04-14 15:19:53 -040053# now bring everything else up
54docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_all
pdragosh3f9a0962019-04-16 13:19:45 -040055
Jim Hahn426ddc12020-04-14 15:19:53 -040056unset http_proxy https_proxy
pdragosh3f9a0962019-04-16 13:19:45 -040057
Jim Hahn426ddc12020-04-14 15:19:53 -040058DROOLS_IP=`get-instance-ip.sh drools`
59XACML_IP=`get-instance-ip.sh policy-xacml-pdp`
60SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
61export SIM_IP
pdragosh3f9a0962019-04-16 13:19:45 -040062
Jim Hahn426ddc12020-04-14 15:19:53 -040063echo DROOLS IP IS ${DROOLS_IP}
64echo XACML IP IS ${XACML_IP}
65echo SIMULATORS IP IS ${SIM_IP}
pdragosh3f9a0962019-04-16 13:19:45 -040066
Jim Hahn426ddc12020-04-14 15:19:53 -040067# activate xacml
68${SCR2}/manage.sh ${SCR2}/activate.xacml.json
pdragosh3f9a0962019-04-16 13:19:45 -040069
Jim Hahn426ddc12020-04-14 15:19:53 -040070# give enough time for the controllers to come up
71sleep 15
a.sreekumar20705742020-02-14 12:03:33 +000072
Jim Hahn426ddc12020-04-14 15:19:53 -040073# wait for xacml to activate
74${SCRIPTS}/policy/wait_for_port.sh ${XACML_IP} 6969
75
76ROBOT_VARIABLES=""
77ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}"
78ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
79ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}"
80ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}"