aboutsummaryrefslogtreecommitdiffstats
path: root/plans/policy/distribution/setup.sh
diff options
context:
space:
mode:
authorGary Wu <gary.wu@futurewei.com>2019-07-08 17:43:25 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-08 17:43:25 +0000
commitca509e7e079d34e723184cab62a3b4783350e2c6 (patch)
tree138fa895f9d492de19abd25f9395675956fd0e8f /plans/policy/distribution/setup.sh
parent4c62996cc2e741e2bfbe1c3562dd046dd070d20d (diff)
parentd46ab2eb2f4254adbe2b9f604b12c0a7f4bf99ed (diff)
Merge "Pull correct docker images for master branch"
Diffstat (limited to 'plans/policy/distribution/setup.sh')
-rw-r--r--plans/policy/distribution/setup.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/plans/policy/distribution/setup.sh b/plans/policy/distribution/setup.sh
index 40a15d12..a7c0a8da 100644
--- a/plans/policy/distribution/setup.sh
+++ b/plans/policy/distribution/setup.sh
@@ -16,16 +16,24 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+# Select branch
+source ${SCRIPTS}/policy/config/policy-csit.conf
+echo ${GERRIT_BRANCH}
-docker run -d --name policy-distribution -p 6969:6969 -it nexus3.onap.org:10001/onap/policy-distribution:2.1.0-SNAPSHOT-latest
+sudo apt-get -y install libxml2-utils
+export POLICY_DISTRIBUTION_VERSION="$(curl -q --silent https://git.onap.org/policy/distribution/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+echo ${POLICY_DISTRIBUTION_VERSION}
+docker run -d --name policy-distribution -p 6969:6969 -it nexus3.onap.org:10001/onap/policy-distribution:${POLICY_DISTRIBUTION_VERSION}
POLICY_DISTRIBUTION_IP=`get-instance-ip.sh policy-distribution`
echo DISTRIBUTION IP IS ${POLICY_DISTRIBUTION_IP}
-# Wait for initialization
-for i in {1..10}; do
- curl -sS ${POLICY_DISTRIBUTION_IP}:6969 && break
- echo sleep $i
- sleep $i
-done
+
+${SCRIPTS}/policy/wait_for_port.sh ${POLICY_DISTRIBUTION_IP} 6969
+rc=$?
+if [[ $rc != 0 ]]; then
+ echo "cannot open ${POLICY_DISTRIBUTION_IP} 6969"
+ docker logs policy-distribution
+ exit $rc
+fi
ROBOT_VARIABLES="-v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}"