pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 2 | # |
| 3 | # ===========LICENSE_START==================================================== |
a.sreekumar | 2070574 | 2020-02-14 12:03:33 +0000 | [diff] [blame] | 4 | # Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 5 | # ============================================================================ |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 6 | # 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 Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 17 | # ============LICENSE_END===================================================== |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 18 | # |
a.sreekumar | 2070574 | 2020-02-14 12:03:33 +0000 | [diff] [blame] | 19 | |
| 20 | # OS upgrades |
| 21 | |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 22 | source ${SCRIPTS}/policy/config/policy-csit.conf |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 23 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 24 | SCR2=${WORKSPACE}/scripts/policy/drools-apps |
| 25 | |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 26 | echo "Uninstall docker-py and reinstall docker." |
| 27 | pip uninstall -y docker-py |
| 28 | pip uninstall -y docker |
| 29 | pip install -U docker==2.7.0 |
| 30 | |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 31 | sudo apt-get -y install libxml2-utils |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame^] | 32 | bash ${SCRIPTS}/policy/get-models-examples.sh |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 33 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame^] | 34 | source ${SCRIPTS}/policy/detmVers.sh |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 35 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame^] | 36 | docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d drools-apps |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 37 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 38 | unset http_proxy https_proxy |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 39 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame^] | 40 | DROOLS_IP=`get-instance-ip.sh drools-apps` |
Jim Hahn | f340ddb | 2020-04-15 08:43:54 -0400 | [diff] [blame] | 41 | API_IP=`get-instance-ip.sh policy-api` |
| 42 | PAP_IP=`get-instance-ip.sh policy-pap` |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 43 | XACML_IP=`get-instance-ip.sh policy-xacml-pdp` |
| 44 | SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` |
| 45 | export SIM_IP |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 46 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 47 | echo DROOLS IP IS ${DROOLS_IP} |
Jim Hahn | f340ddb | 2020-04-15 08:43:54 -0400 | [diff] [blame] | 48 | echo API IP IS ${API_IP} |
| 49 | echo PAP IP IS ${PAP_IP} |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 50 | echo XACML IP IS ${XACML_IP} |
| 51 | echo SIMULATORS IP IS ${SIM_IP} |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 52 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame^] | 53 | # wait for the app to start up |
| 54 | ${SCRIPTS}/policy/wait_for_port.sh ${DROOLS_IP} 6969 |
| 55 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 56 | # give enough time for the controllers to come up |
| 57 | sleep 15 |
a.sreekumar | 2070574 | 2020-02-14 12:03:33 +0000 | [diff] [blame] | 58 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame^] | 59 | DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 60 | |
| 61 | ROBOT_VARIABLES="" |
| 62 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}" |
Jim Hahn | f340ddb | 2020-04-15 08:43:54 -0400 | [diff] [blame] | 63 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 64 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}" |
Jim Hahn | f340ddb | 2020-04-15 08:43:54 -0400 | [diff] [blame] | 65 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}" |
| 66 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}" |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame] | 67 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}" |
| 68 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}" |