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 |
| 23 | export POLICY_MARIADB_VER |
| 24 | echo ${GERRIT_BRANCH} |
| 25 | echo ${POLICY_MARIADB_VER} |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 26 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 27 | SCR2=${WORKSPACE}/scripts/policy/drools-apps |
| 28 | |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 29 | echo "Uninstall docker-py and reinstall docker." |
| 30 | pip uninstall -y docker-py |
| 31 | pip uninstall -y docker |
| 32 | pip install -U docker==2.7.0 |
| 33 | |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 34 | sudo apt-get -y install libxml2-utils |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 35 | ${SCRIPTS}/policy/policy-models-simulators.sh |
| 36 | |
| 37 | POLICY_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()' -)" |
| 38 | export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest" |
Bilal A | 71e5737 | 2019-12-17 02:17:57 +0000 | [diff] [blame] | 39 | POLICY_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()' -)" |
| 40 | echo ${POLICY_DROOLS_APPS_VERSION_EXTRACT} |
| 41 | export POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest" |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 42 | |
| 43 | echo ${POLICY_XACML_PDP_VERSION} |
Bilal A | 71e5737 | 2019-12-17 02:17:57 +0000 | [diff] [blame] | 44 | echo ${POLICY_DROOLS_APPS_VERSION} |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 45 | |
a.sreekumar | 2070574 | 2020-02-14 12:03:33 +0000 | [diff] [blame] | 46 | echo "user information: $(id)" |
| 47 | echo "docker and docker-compose versions:" |
| 48 | docker -v && docker-compose -v |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 49 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 50 | # Adding this waiting container due to race condition between drools and mariadb |
| 51 | docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_dependencies |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 52 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 53 | # now bring everything else up |
| 54 | docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_all |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 55 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 56 | unset http_proxy https_proxy |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 57 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 58 | DROOLS_IP=`get-instance-ip.sh drools` |
| 59 | XACML_IP=`get-instance-ip.sh policy-xacml-pdp` |
| 60 | SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` |
| 61 | export SIM_IP |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 62 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 63 | echo DROOLS IP IS ${DROOLS_IP} |
| 64 | echo XACML IP IS ${XACML_IP} |
| 65 | echo SIMULATORS IP IS ${SIM_IP} |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 66 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 67 | # activate xacml |
| 68 | ${SCR2}/manage.sh ${SCR2}/activate.xacml.json |
pdragosh | 3f9a096 | 2019-04-16 13:19:45 -0400 | [diff] [blame] | 69 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 70 | # give enough time for the controllers to come up |
| 71 | sleep 15 |
a.sreekumar | 2070574 | 2020-02-14 12:03:33 +0000 | [diff] [blame] | 72 | |
Jim Hahn | 426ddc1 | 2020-04-14 15:19:53 -0400 | [diff] [blame^] | 73 | # wait for xacml to activate |
| 74 | ${SCRIPTS}/policy/wait_for_port.sh ${XACML_IP} 6969 |
| 75 | |
| 76 | ROBOT_VARIABLES="" |
| 77 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}" |
| 78 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}" |
| 79 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}" |
| 80 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}" |