2 # ============LICENSE_START=======================================================
3 # Copyright (C) 2018 Ericsson. All rights reserved.
5 # Modifications copyright (c) 2019 Nordix Foundation.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 # SPDX-License-Identifier: Apache-2.0
20 # ============LICENSE_END=========================================================
22 echo "Uninstall docker-py and reinstall docker."
23 pip uninstall -y docker-py
24 pip uninstall -y docker
25 pip install -U docker==2.7.0
27 # the directory of the script
28 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
31 # the temp directory used, within $DIR
32 # omit the -p parameter to create a temporal directory in the default location
33 WORK_DIR=`mktemp -d -p "$DIR"`
38 # check if tmp dir was created
39 if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
40 echo "Could not create temp dir"
47 curl -O http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
48 tar -xzvf apache-maven-3.3.9-bin.tar.gz
50 export PATH=${PATH}:${WORK_DIR}/maven/apache-maven-3.3.9/bin
51 ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v
54 git clone http://gerrit.onap.org/r/oparent
55 git clone --depth 1 https://gerrit.onap.org/r/policy/models -b master
56 cd models/models-sim/models-sim-dmaap
57 ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn clean install -DskipTests --settings ${WORK_DIR}/oparent/settings.xml
58 bash ./src/main/package/docker/docker_build.sh
63 # Adding this waiting container due to race condition between pap and mariadb
64 docker-compose -f ${WORKSPACE}/scripts/policy/policy-apex-pdp/docker-compose-apex.yml run --rm start_dependencies
65 docker-compose -f ${WORKSPACE}/scripts/policy/policy-apex-pdp/docker-compose-apex.yml up -d
67 POLICY_API_IP=`get-instance-ip.sh policy-api`
68 POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
69 MARIADB_IP=`get-instance-ip.sh mariadb`
70 APEX_IP=`get-instance-ip.sh policy-apex-pdp`
71 DMAAP_IP=`get-instance-ip.sh dmaap-simulator`
73 echo PAP IP IS ${POLICY_PAP_IP}
74 echo MARIADB IP IS ${MARIADB_IP}
75 echo API IP IS ${POLICY_API_IP}
76 echo APEX IP IS ${APEX_IP}
77 echo DMAAP_IP IS ${DMAAP_IP}
79 # Wait for initialization
81 curl -sS ${MARIADB_IP}:3306 && break
86 curl -sS ${APEX_IP}:6969 && break
91 curl -sS ${DMAAP_IP}:3904 && break
95 #Configure the database
96 docker exec -it mariadb chmod +x /docker-entrypoint-initdb.d/db.sh
97 docker exec -it mariadb /docker-entrypoint-initdb.d/db.sh
99 ROBOT_VARIABLES="-v APEX_IP:${APEX_IP} -v POLICY_API_IP:${POLICY_API_IP} -v POLICY_PAP_IP:${POLICY_PAP_IP}"