Dependency management update
[policy/pap.git] / testsuites / stability / src / main / resources / papsetup / setup_pap.sh
1 #!/bin/bash
2 # ============LICENSE_START=======================================================
3 #  Copyright (c) 2019 Nordix Foundation.
4 # ================================================================================
5 # 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 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 # the directory of the script
21 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
22 echo ${DIR}
23
24 if ["$#" -lt 2]; then
25         echo "PAP and MariaDB IPs should be passed as two parameters. PAP IP goes first."
26         exit 1
27 else
28     PAP=$1
29     echo "PAP IP: ${PAP}"
30     MARIADB=$2
31     echo "MariaDB IP: ${MARIADB}"
32 fi
33
34 docker run -p 9090:9090 -p 6969:6969 -e "PAP_HOST=${PAP}" -v ${DIR}/config/pap/bin/policy-pap.sh:/opt/app/policy/pap/bin/policy-pap.sh -v ${DIR}/config/pap/etc/defaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json --add-host mariadb:${MARIADB} --name policy-pap -d --rm nexus3.onap.org:10001/onap/policy-pap:2.0.0-SNAPSHOT-latest