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/utils.sh b/utils.sh
index 0cf0915..87899b3 100644
--- a/utils.sh
+++ b/utils.sh
@@ -21,15 +21,15 @@
   source "$host_env"
 else
   # Are we running on Arm infrastructure?
-  if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+  if echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
     source "$ci_root/arm-env.sh"
-  elif echo "$JENKINS_URL" | grep -q "ci.trustedfirmware.org"; then
+  elif echo "$JENKINS_PUBLIC_URL" | grep -q "ci.trustedfirmware.org"; then
     if echo "$TF_GERRIT_BRANCH" | grep -q "lts-v2.8"; then
       source "$ci_root/openci-lts-v2.8-env.sh"
     else
       source "$ci_root/openci-env.sh"
     fi
-  elif echo "$JENKINS_URL" | grep -q "ci.staging.trustedfirmware.org"; then
+  elif echo "$JENKINS_PUBLIC_URL" | grep -q "ci.staging.trustedfirmware.org"; then
     source "$ci_root/openci-staging-env.sh"
   fi
 fi
@@ -542,7 +542,7 @@
 
 # See if execution is done by Jenkins. If called with a parameter,
 # representing a 'domain', e.g. arm.com, it will also check if
-# JENKINS_URL contains the latter.
+# JENKINS_PUBLIC_URL contains the latter.
 is_jenkins_env () {
     local domain="${1-}"
 
@@ -553,7 +553,7 @@
     # if no parameter passed, no more checks, quit
     [ -z "$domain" ] && return 0
 
-    if echo "$JENKINS_URL" | grep -q "$domain"; then
+    if echo "$JENKINS_PUBLIC_URL" | grep -q "$domain"; then
 	return 0
     fi
 
@@ -589,7 +589,7 @@
 project_filer="${nfs_volume}/projectscratch/ssg/trusted-fw"
 project_scratch="${PROJECT_SCRATCH:-$project_filer/ci-workspace}"
 warehouse="${nfs_volume}/warehouse"
-jenkins_url="${JENKINS_URL%/*}"
+jenkins_url="${JENKINS_PUBLIC_URL%/*}"
 jenkins_url="${jenkins_url:-https://ci.trustedfirmware.org/}"
 
 # Model revisions