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: I3ddf9ebc12f2c9bf045366ee548f23df12656f8f
Signed-off-by: Arthur She <arthur.she@linaro.org>
(cherry picked from commit a813bdf49920a1295f56caa9f79f33334150c911)
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 e40263e..1d60875 100644
--- a/script/gen_merge_report.sh
+++ b/script/gen_merge_report.sh
@@ -9,7 +9,7 @@
 REPORT_JSON=$1
 REPORT_HTML=$2
 
-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/qa-code-coverage'
   INFO_PATH='coverage.info'
   JSON_PATH='intermediate_layer.json'
@@ -35,7 +35,7 @@
 import os
 import re
 
-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:
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/tf-coverity/common-def.sh b/script/tf-coverity/common-def.sh
index 71d76f5..98edb06 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