blob: 1a1dc331ecfd8415c9d201ca75d533b992986516 [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
Jim Hahnf340ddb2020-04-15 08:43:54 -040037POLICY_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()' -)"
38export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
39POLICY_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()' -)"
40export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
Jim Hahn426ddc12020-04-14 15:19:53 -040041POLICY_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()' -)"
42export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
Bilal A71e57372019-12-17 02:17:57 +000043POLICY_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()' -)"
44echo ${POLICY_DROOLS_APPS_VERSION_EXTRACT}
45export POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
Jim Hahn426ddc12020-04-14 15:19:53 -040046
47echo ${POLICY_XACML_PDP_VERSION}
Bilal A71e57372019-12-17 02:17:57 +000048echo ${POLICY_DROOLS_APPS_VERSION}
Bilal Ad46ab2e2019-06-07 21:25:59 +000049
a.sreekumar20705742020-02-14 12:03:33 +000050echo "user information: $(id)"
51echo "docker and docker-compose versions:"
52docker -v && docker-compose -v
pdragosh3f9a0962019-04-16 13:19:45 -040053
Jim Hahn426ddc12020-04-14 15:19:53 -040054# Adding this waiting container due to race condition between drools and mariadb
55docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_dependencies
pdragosh3f9a0962019-04-16 13:19:45 -040056
Jim Hahnf340ddb2020-04-15 08:43:54 -040057# Adding this waiting container due to race condition between pap and xacml
58docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_pap
59
Jim Hahn426ddc12020-04-14 15:19:53 -040060# now bring everything else up
61docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_all
pdragosh3f9a0962019-04-16 13:19:45 -040062
Jim Hahn426ddc12020-04-14 15:19:53 -040063unset http_proxy https_proxy
pdragosh3f9a0962019-04-16 13:19:45 -040064
Jim Hahn426ddc12020-04-14 15:19:53 -040065DROOLS_IP=`get-instance-ip.sh drools`
Jim Hahnf340ddb2020-04-15 08:43:54 -040066API_IP=`get-instance-ip.sh policy-api`
67PAP_IP=`get-instance-ip.sh policy-pap`
Jim Hahn426ddc12020-04-14 15:19:53 -040068XACML_IP=`get-instance-ip.sh policy-xacml-pdp`
69SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
70export SIM_IP
pdragosh3f9a0962019-04-16 13:19:45 -040071
Jim Hahn426ddc12020-04-14 15:19:53 -040072echo DROOLS IP IS ${DROOLS_IP}
Jim Hahnf340ddb2020-04-15 08:43:54 -040073echo API IP IS ${API_IP}
74echo PAP IP IS ${PAP_IP}
Jim Hahn426ddc12020-04-14 15:19:53 -040075echo XACML IP IS ${XACML_IP}
76echo SIMULATORS IP IS ${SIM_IP}
pdragosh3f9a0962019-04-16 13:19:45 -040077
Jim Hahn426ddc12020-04-14 15:19:53 -040078# give enough time for the controllers to come up
79sleep 15
a.sreekumar20705742020-02-14 12:03:33 +000080
Jim Hahnf340ddb2020-04-15 08:43:54 -040081DATA=${WORKSPACE}/simulators/models/models-examples/src/main/resources/policies
Jim Hahn426ddc12020-04-14 15:19:53 -040082
83ROBOT_VARIABLES=""
84ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}"
Jim Hahnf340ddb2020-04-15 08:43:54 -040085ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
Jim Hahn426ddc12020-04-14 15:19:53 -040086ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
Jim Hahnf340ddb2020-04-15 08:43:54 -040087ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}"
88ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}"
Jim Hahn426ddc12020-04-14 15:19:53 -040089ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}"
90ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}"