Replace JENKINS_URL with JENKINS_PUBLIC_URL

To ensure tf-a-ci-scripts can run on both OpenCI
and Arm Test CI, JENKINS_URL has been replaced with
JENKINS_PUBLIC_URL, as JENKINS_URL is a reserved
private URL in Arm infrastructure.

JENKINS_PUBLIC_URL is a system-wide environment
variable and was configured in:
Manage Jenkins > System > Global Properties

Default values:
OpenCI Production Jenkins: https://ci.trustedfirmware.org/
OpenCI Staging Jenkins: https://ci.staging.trustedfirmware
.org/
arm test CI: https://jenkins.openci-test.arm.com/

Change-Id: I2dee2619bb99c88ef40d37534ea8867880cb8d41
Signed-off-by: Saheer Babu <saheer.babu@arm.com>
diff --git a/script/artefacts_receiver.py b/script/artefacts_receiver.py
index 227d047..b9d0f3d 100755
--- a/script/artefacts_receiver.py
+++ b/script/artefacts_receiver.py
@@ -28,7 +28,7 @@
 import urllib.request
 
 
-JENKINS_URL = "http://jenkins.oss.arm.com"
+JENKINS_PUBLIC_URL = "http://jenkins.oss.arm.com"
 counter = itertools.count()
 exiting = False
 more_consoles = threading.Event()
@@ -44,7 +44,7 @@
         self.job = job
         self.build = build
         self.path = path
-        self.url = "/".join([JENKINS_URL, "job", self.job, self.build])
+        self.url = "/".join([JENKINS_PUBLIC_URL, "job", self.job, self.build])
 
     def download_console(self, more):
         console_url = "/".join([self.url, "consoleText"])
diff --git a/script/coverity_wrapper.sh b/script/coverity_wrapper.sh
index 7a0959c..aed88ec 100644
--- a/script/coverity_wrapper.sh
+++ b/script/coverity_wrapper.sh
@@ -35,7 +35,7 @@
 	local need_compare
 
 	# If auth file is not provided and if on Arm infrastructure copy it
-	if [ -z "$auth_file" ] && echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+	if [ -z "$auth_file" ] && echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
 		local auth_url="$project_filer/ci-files/coverity/tfcibot@$coverity_host"
 		url="$auth_url" saveas="$workspace/tfcibot@$coverity_host" fetch_file
 		auth_file="$workspace/tfcibot@$coverity_host"
diff --git a/script/fvp-launcher.sh b/script/fvp-launcher.sh
index f5a728b..b13aa8c 100755
--- a/script/fvp-launcher.sh
+++ b/script/fvp-launcher.sh
@@ -35,7 +35,7 @@
 declare -A urls
 
 ## Must params
-JENKINS_URL="${1:?}"
+JENKINS_PUBLIC_URL="${1:?}"
 
 
 ## Optional params passed through env variables
@@ -46,11 +46,11 @@
 DOCKER_CMDS_FILE="${DOCKER_CMDS_FILE:-./docker.txt}"
 BM_CMDS_FILE="${BM_CMDS_FILE:-./bm.txt}"
 
-JENKINS_URL="${JENKINS_URL}/artifact/lava.log"
+JENKINS_PUBLIC_URL="${JENKINS_PUBLIC_URL}/artifact/lava.log"
 
 
 # Fetch the LAVA log
-r_curl "${LAVA_LOG}" "${JENKINS_URL}"
+r_curl "${LAVA_LOG}" "${JENKINS_PUBLIC_URL}"
 
 # Get download directories from the lava log
 i=1
diff --git a/script/gen_merge_report.sh b/script/gen_merge_report.sh
index fed9256..434e341 100644
--- a/script/gen_merge_report.sh
+++ b/script/gen_merge_report.sh
@@ -9,7 +9,7 @@
 REPORT_HTML=$2
 TEST_DEF_FOLDER="${WORKSPACE}/test-definitions"
 
-if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+if echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
 ARTIFACT_PATH='artifact/html'
 INFO_PATH='lcov_report/coverage.info'
 JSON_PATH='output_file.json'
@@ -37,7 +37,7 @@
 import json
 import os
 
-server = os.getenv("JENKINS_URL", "https://jenkins.oss.arm.com/")
+server = os.getenv("JENKINS_PUBLIC_URL", "https://jenkins.oss.arm.com/")
 merge_json = {} # json object
 _files = []
 with open("$REPORT_JSON") as json_file:
@@ -155,7 +155,7 @@
         git checkout $TEST_DEFINITIONS_REFSPEC
     popd
 
-    if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+    if echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
     bash $TEST_DEF_FOLDER/scripts/tools/code_coverage/fastmodel_baremetal/bmcov/report/branch_coverage/merge.sh \
         -j $MERGE_JSON -l ${OUTDIR} -p $project
     else
diff --git a/script/gen_test_report.py b/script/gen_test_report.py
index d32b118..7953cfb 100755
--- a/script/gen_test_report.py
+++ b/script/gen_test_report.py
@@ -393,7 +393,7 @@
             Build_job = opts.build_job
             json_obj["build_job"] = Build_job
 
-        Jenkins = os.environ["JENKINS_URL"].strip().rstrip("/")
+        Jenkins = os.environ["JENKINS_PUBLIC_URL"].strip().rstrip("/")
 
         # Replace non-alphabetical characters in the job name with underscores. This is
         # how Jenkins does it too.
diff --git a/script/test_definitions.sh b/script/test_definitions.sh
index f81bdb8..d8009cf 100644
--- a/script/test_definitions.sh
+++ b/script/test_definitions.sh
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
-if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+if echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
 
 export GERRIT_URL=${GERRIT_URL:-https://gerrit.oss.arm.com}
 export TEST_DEFINITIONS_REPO=${TEST_DEFINITIONS_REPO:-${GERRIT_URL}/tests/lava/test-definitions.git}
diff --git a/script/tf-coverity/common-def.sh b/script/tf-coverity/common-def.sh
index a165980..cecedab 100644
--- a/script/tf-coverity/common-def.sh
+++ b/script/tf-coverity/common-def.sh
@@ -38,7 +38,7 @@
 # infrastructure)
 is_arm_jenkins_env() {
     if [ "$JENKINS_HOME" ]; then
-	if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+	if echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
 	    return 0;
 	fi
     fi