blob: d50106ffc234825132bda55b62e3e4cd54ec973f [file] [log] [blame]
Bilal Ab4bf5da2019-03-14 16:45:23 +00001#!/bin/bash
a.sreekumar20705742020-02-14 12:03:33 +00002# ============LICENSE_START=======================================================
3# Copyright 2017-2020 AT&T Intellectual Property. All rights reserved.
4# ================================================================================
Bilal Ab4bf5da2019-03-14 16:45:23 +00005# 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#
a.sreekumar20705742020-02-14 12:03:33 +000017# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
Bilal Ab4bf5da2019-03-14 16:45:23 +000019
a.sreekumar20705742020-02-14 12:03:33 +000020# OS upgrades
jhhde399b02019-04-29 20:17:45 -050021
a.sreekumar20705742020-02-14 12:03:33 +000022echo "Uninstall docker-py and reinstall docker."
23pip uninstall -y docker-py
24pip uninstall -y docker
25pip install -U docker==2.7.0
Bilal Ab4bf5da2019-03-14 16:45:23 +000026
a.sreekumar20705742020-02-14 12:03:33 +000027echo "user information: $(id)"
28echo "docker information:"
29docker -v && docker-compose -v && docker info
Bilal Ab4bf5da2019-03-14 16:45:23 +000030
a.sreekumar20705742020-02-14 12:03:33 +000031# Component Versions
32
33source ${SCRIPTS}/policy/config/policy-csit.conf
34export POLICY_MARIADB_VER
35echo ${GERRIT_BRANCH}
36echo ${POLICY_MARIADB_VER}
37
38sudo apt-get -y install libxml2-utils
39POLICY_DROOLS_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()' -)"
40export POLICY_DROOLS_VERSION="${POLICY_DROOLS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
41echo ${POLICY_DROOLS_VERSION}
42
43docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools.yml up -d
44sleep 2m
45
46docker container ls -a
47
48POLICY_DROOLS_IP=`get-instance-ip.sh drools`
49MARIADB_IP=`get-instance-ip.sh mariadb`
50
51echo DROOLS IP IS ${POLICY_DROOLS_IP}
52echo MARIADB IP IS ${MARIADB_IP}
53
54for i in {1..10}; do
55 curl -sS ${POLICY_DROOLS_IP}:9696 && break
56 echo sleep $i
57 sleep $i
58done
59
60ROBOT_VARIABLES="-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}"