Use github in lieu of gerrit mirror 39/120339/4
authorJim Hahn <jrh3@att.com>
Thu, 8 Apr 2021 19:28:15 +0000 (15:28 -0400)
committerJim Hahn <jrh3@att.com>
Thu, 8 Apr 2021 20:05:49 +0000 (16:05 -0400)
The gerrit mirror is not always accessible behind corporate firewalls,
thus changed the CSITs to use github instead.
Also modified the script to only clone ci-management to /tmp if it
does not already exist.

Issue-ID: POLICY-3179
Change-Id: I9cac98b04e000d9365e05a1f2ca1c328fef14c6c
Signed-off-by: Jim Hahn <jrh3@att.com>
csit/detmVers.sh
csit/get-models-examples.sh
csit/prepare-csit.sh
csit/run-project-csit.sh

index 1906292..56e516c 100644 (file)
@@ -20,58 +20,43 @@ source ${SCRIPTS}/get-branch-mariadb.sh
 
 echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
 
-POLICY_MODELS_VERSION=$(
-    curl -q --silent \
-      https://git.onap.org/policy/models/plain/pom.xml?h=${GERRIT_BRANCH} |
-    xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)
+function getVersion
+{
+    REPO=$1
+    curl -qL --silent \
+      https://github.com/onap/policy-$REPO/raw/${GERRIT_BRANCH}/pom.xml |
+    xmllint --xpath \
+      '/*[local-name()="project"]/*[local-name()="version"]/text()' -
+}
+
+POLICY_MODELS_VERSION=$(getVersion models)
 export POLICY_MODELS_VERSION=${POLICY_MODELS_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_MODELS_VERSION=${POLICY_MODELS_VERSION}
 
-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()' -)
+POLICY_API_VERSION=$(getVersion api)
 export POLICY_API_VERSION=${POLICY_API_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_API_VERSION=${POLICY_API_VERSION}
 
-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()' -)
+POLICY_PAP_VERSION=$(getVersion pap)
 export POLICY_PAP_VERSION=${POLICY_PAP_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_PAP_VERSION=${POLICY_PAP_VERSION}
 
-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()' -)
+POLICY_XACML_PDP_VERSION=$(getVersion xacml-pdp)
 export POLICY_XACML_PDP_VERSION=${POLICY_XACML_PDP_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_XACML_PDP_VERSION=${POLICY_XACML_PDP_VERSION}
 
-POLICY_DROOLS_VERSION=$(
-    curl -q --silent \
-      https://git.onap.org/policy/drools-pdp/plain/pom.xml?h=${GERRIT_BRANCH} |
-    xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)
+POLICY_DROOLS_VERSION=$(getVersion drools-pdp)
 export POLICY_DROOLS_VERSION=${POLICY_DROOLS_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_DROOLS_VERSION=${POLICY_DROOLS_VERSION}
 
-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()' -)
+POLICY_DROOLS_APPS_VERSION=$(getVersion drools-applications)
 export POLICY_DROOLS_APPS_VERSION=${POLICY_DROOLS_APPS_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_DROOLS_APPS_VERSION=${POLICY_DROOLS_APPS_VERSION}
 
-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()' -)
+POLICY_APEX_PDP_VERSION=$(getVersion apex-pdp)
 export POLICY_APEX_PDP_VERSION=${POLICY_APEX_PDP_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_APEX_PDP_VERSION=${POLICY_APEX_PDP_VERSION}
 
-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()' -)
+POLICY_DISTRIBUTION_VERSION=$(getVersion distribution)
 export POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION:0:3}-SNAPSHOT-latest
 echo POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION}
index 75b6528..e83b024 100644 (file)
@@ -24,4 +24,4 @@ mkdir ${WORKSPACE}/models
 cd ${WORKSPACE}
 
 # download models examples
-git clone -b ${GERRIT_BRANCH} --single-branch git://gerrit-mirror-ap.onap.org/mirror/policy/models.git
+git clone -b ${GERRIT_BRANCH} --single-branch https://github.com/onap/policy-models.git models
index 4275841..b15aa4e 100755 (executable)
@@ -33,11 +33,11 @@ if [ -f ${WORKSPACE}/env.properties ]; then
 fi
 if [ -f ${ROBOT_VENV}/bin/activate ]; then
     source ${ROBOT_VENV}/bin/activate
-else
+elif [ ! -d /tmp/ci-management ]; then
     rm -rf /tmp/ci-management
     rm -f ${WORKSPACE}/env.properties
     cd /tmp
-    git clone -b master --single-branch git://gerrit-mirror-ap.onap.org/mirror/ci-management.git
+    git clone -b master --single-branch https://github.com/onap/ci-management.git
     source /tmp/ci-management/jjb/integration/include-raw-integration-install-robotframework.sh
 fi
 
index c3d67d9..07b9dea 100755 (executable)
@@ -150,7 +150,7 @@ mkdir ${WORKSPACE}/${PROJECT}
 cd ${WORKSPACE}
 
 # get the plan from git clone
-if ! `git clone -b ${GERRIT_BRANCH} --single-branch git://gerrit-mirror-ap.onap.org/mirror/policy/${PROJECT}.git` ; then
+if ! `git clone -b ${GERRIT_BRANCH} --single-branch https://github.com/onap/policy-${PROJECT}.git ${PROJECT}` ; then
     echo "repo not found: policy/${PROJECT}"
     exit 1
 fi