aboutsummaryrefslogtreecommitdiffstats
path: root/plans/policy
diff options
context:
space:
mode:
authorBilal A <bilal@research.att.com>2019-06-07 21:25:59 +0000
committerBilal A <bilal@research.att.com>2019-07-03 16:06:05 +0000
commitd46ab2eb2f4254adbe2b9f604b12c0a7f4bf99ed (patch)
tree9c78e684c231f69dd42fbb29d2e9bfbea68f82d7 /plans/policy
parent4a70dd3bcf1dde19d511f528650b08714b92448f (diff)
Pull correct docker images for master branch
Enables Policy CSITs for API, PAP, Distribution, Drools-applications, Apex-PDP and XACML-PDP to pull correct docker images based on the code branch. -------------- Updating the policy model json in apex-pdp csit Changes were made to read the policy model as proper json instead of json formatted string in APEX-PDP. With this fix in place, the policy tosca json file need to be updated with the proper json. Issue-ID: POLICY-1836 Issue-ID: POLICY-1796 Change-Id: I6b99c8ae9cb78dd8ebddc522bc2a7080ec6e5735 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech> Signed-off-by: Bilal A <bilal@research.att.com>
Diffstat (limited to 'plans/policy')
-rw-r--r--plans/policy/apex-pdp/setup.sh15
-rw-r--r--plans/policy/api/setup.sh10
-rw-r--r--plans/policy/distribution/setup.sh22
-rwxr-xr-xplans/policy/drools-applications/setup.sh8
-rw-r--r--plans/policy/pap/setup.sh11
-rw-r--r--plans/policy/xacml-pdp/setup.sh17
6 files changed, 74 insertions, 9 deletions
diff --git a/plans/policy/apex-pdp/setup.sh b/plans/policy/apex-pdp/setup.sh
index 1e61726b..22e813df 100644
--- a/plans/policy/apex-pdp/setup.sh
+++ b/plans/policy/apex-pdp/setup.sh
@@ -19,6 +19,10 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+source ${SCRIPTS}/policy/config/policy-csit.conf
+export POLICY_MARIADB_VER
+echo ${GERRIT_BRANCH}
+echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
@@ -53,7 +57,7 @@ ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v
cd ..
git clone http://gerrit.onap.org/r/oparent
-git clone --depth 1 https://gerrit.onap.org/r/policy/models -b master
+git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH}
cd models/models-sim/models-sim-dmaap
${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn clean install -DskipTests --settings ${WORK_DIR}/oparent/settings.xml
bash ./src/main/package/docker/docker_build.sh
@@ -61,6 +65,15 @@ cd ${WORKSPACE}
rm -rf ${WORK_DIR}
sleep 3
+sudo apt-get -y install libxml2-utils
+export POLICY_API_VERSION="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_PAP_VERSION="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_APEX_PDP_VERSION="$(curl -q --silent https://git.onap.org/policy/apex-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+
+echo ${POLICY_API_VERSION}
+echo ${POLICY_PAP_VERSION}
+echo ${POLICY_APEX_PDP_VERSION}
+
# Adding this waiting container due to race condition between pap and mariadb
docker-compose -f ${WORKSPACE}/scripts/policy/policy-apex-pdp/docker-compose-apex.yml run --rm start_dependencies
diff --git a/plans/policy/api/setup.sh b/plans/policy/api/setup.sh
index 6168085e..91e1edee 100644
--- a/plans/policy/api/setup.sh
+++ b/plans/policy/api/setup.sh
@@ -17,11 +17,21 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+# Select branch
+source ${SCRIPTS}/policy/config/policy-csit.conf
+export POLICY_MARIADB_VER
+echo ${GERRIT_BRANCH}
+echo ${POLICY_MARIADB_VER}
+
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
+
+sudo apt-get -y install libxml2-utils
+export POLICY_API_VERSION="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+echo ${POLICY_API_VERSION}
# Adding this waiting container to avoid race condition between api and mariadb containers.
docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-api.yml run --rm start_dependencies
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}"
diff --git a/plans/policy/drools-applications/setup.sh b/plans/policy/drools-applications/setup.sh
index 24422a63..e2ca7893 100755
--- a/plans/policy/drools-applications/setup.sh
+++ b/plans/policy/drools-applications/setup.sh
@@ -16,12 +16,20 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+source ${SCRIPTS}/policy/config/policy-csit.conf
+export POLICY_MARIADB_VER
+echo ${GERRIT_BRANCH}
+echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
+sudo apt-get -y install libxml2-utils
+export POLICY_DROOLS_APPS_VERSION="$(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()' -)"
+echo ${POLICY_DRROLS_APPS_VERSION}
+
docker login -u docker -p docker nexus3.onap.org:10001
# Adding this waiting container to avoid race condition between api and mariadb containers.
diff --git a/plans/policy/pap/setup.sh b/plans/policy/pap/setup.sh
index 8bd3f0ac..0f1ab746 100644
--- a/plans/policy/pap/setup.sh
+++ b/plans/policy/pap/setup.sh
@@ -18,11 +18,22 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+source ${SCRIPTS}/policy/config/policy-csit.conf
+export POLICY_MARIADB_VER
+echo ${GERRIT_BRANCH}
+echo ${POLICY_MARIADB_VER}
+
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
+
+sudo apt-get -y install libxml2-utils
+export POLICY_API_VERSION="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_PAP_VERSION="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+echo ${POLICY_API_VERSION}
+echo ${POLICY_PAP_VERSION}
# Adding this waiting container due to race condition between pap and mariadb
docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-pap.yml run --rm start_dependencies
diff --git a/plans/policy/xacml-pdp/setup.sh b/plans/policy/xacml-pdp/setup.sh
index 24fc2d7c..1d4325bd 100644
--- a/plans/policy/xacml-pdp/setup.sh
+++ b/plans/policy/xacml-pdp/setup.sh
@@ -17,6 +17,11 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+source ${SCRIPTS}/policy/config/policy-csit.conf
+export POLICY_MARIADB_VER
+echo ${GERRIT_BRANCH}
+echo ${POLICY_MARIADB_VER}
+
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
@@ -50,7 +55,7 @@ ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v
cd ..
git clone http://gerrit.onap.org/r/oparent
-git clone --depth 1 https://gerrit.onap.org/r/policy/models -b master
+git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH}
cd models/models-sim/models-sim-dmaap
${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn clean install -DskipTests --settings ${WORK_DIR}/oparent/settings.xml
bash ./src/main/package/docker/docker_build.sh
@@ -58,6 +63,16 @@ cd ${WORKSPACE}
rm -rf ${WORK_DIR}
sleep 3
+
+
+sudo apt-get -y install libxml2-utils
+export POLICY_API_VERSION="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_PAP_VERSION="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_XACML_PDP_VERSION="$(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()' -)"
+
+echo ${POLICY_API_VERSION}
+echo ${POLICY_PAP_VERSION}
+echo ${POLICY_XACML_PDP_VERSION}
# Adding this waiting container due to race condition between pap and mariadb
docker-compose -f ${WORKSPACE}/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml run --rm start_dependencies