ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2019 Nordix Foundation. |
Jim Hahn | 1ebe7ec | 2020-04-02 13:32:01 -0400 | [diff] [blame] | 4 | # Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 5 | # ================================================================================ |
| 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. |
| 17 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ============LICENSE_END========================================================= |
| 20 | |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 21 | source ${SCRIPTS}/policy/config/policy-csit.conf |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 22 | |
Bilal A | 95097c2 | 2019-04-12 22:38:32 +0000 | [diff] [blame] | 23 | echo "Uninstall docker-py and reinstall docker." |
| 24 | pip uninstall -y docker-py |
| 25 | pip uninstall -y docker |
| 26 | pip install -U docker==2.7.0 |
| 27 | |
Bilal A | d46ab2e | 2019-06-07 21:25:59 +0000 | [diff] [blame] | 28 | sudo apt-get -y install libxml2-utils |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame] | 29 | bash ${SCRIPTS}/policy/get-models-examples.sh |
Jim Hahn | 09148c8 | 2020-09-02 11:16:16 -0400 | [diff] [blame] | 30 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame] | 31 | source ${SCRIPTS}/policy/detmVers.sh |
Jim Hahn | 09148c8 | 2020-09-02 11:16:16 -0400 | [diff] [blame] | 32 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame] | 33 | docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d pap |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 34 | |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 35 | unset http_proxy https_proxy |
| 36 | |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 37 | POLICY_PAP_IP=`get-instance-ip.sh policy-pap` |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 38 | POLICY_API_IP=`get-instance-ip.sh policy-api` |
Bilal A | 95097c2 | 2019-04-12 22:38:32 +0000 | [diff] [blame] | 39 | MARIADB_IP=`get-instance-ip.sh mariadb` |
| 40 | |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 41 | echo PAP IP IS ${POLICY_PAP_IP} |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 42 | echo API IP IS ${POLICY_API_IP} |
Bilal A | 95097c2 | 2019-04-12 22:38:32 +0000 | [diff] [blame] | 43 | echo MARIADB IP IS ${MARIADB_IP} |
Bilal A | 95097c2 | 2019-04-12 22:38:32 +0000 | [diff] [blame] | 44 | |
Jim Hahn | 0053242 | 2020-09-17 17:03:34 -0400 | [diff] [blame] | 45 | |
| 46 | # wait for the app to start up |
| 47 | ${SCRIPTS}/policy/wait_for_port.sh ${POLICY_PAP_IP} 6969 |
| 48 | |
| 49 | |
| 50 | DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies |
Jim Hahn | 09148c8 | 2020-09-02 11:16:16 -0400 | [diff] [blame] | 51 | |
Jim Hahn | 1ebe7ec | 2020-04-02 13:32:01 -0400 | [diff] [blame] | 52 | ROBOT_VARIABLES="" |
| 53 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}" |
| 54 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}" |
Jim Hahn | 09148c8 | 2020-09-02 11:16:16 -0400 | [diff] [blame] | 55 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" |