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/job/tf-ci-gateway/generate_report.sh b/job/tf-ci-gateway/generate_report.sh
index 4f9d8b7..b9e31ea 100755
--- a/job/tf-ci-gateway/generate_report.sh
+++ b/job/tf-ci-gateway/generate_report.sh
@@ -30,7 +30,7 @@
fi
# set proper jobs names for test generation report script
- if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
+ if echo "$JENKINS_PUBLIC_URL" | grep -q "oss.arm.com"; then
worker_job="${worker_job:-tf-worker}"
lava_job="${lava_job:-tf-build-for-lava}"
else
diff --git a/openci-env.sh b/openci-env.sh
index 26cd707..fb23b5c 100644
--- a/openci-env.sh
+++ b/openci-env.sh
@@ -10,7 +10,7 @@
#
nfs_volume="${WORKSPACE:?}/nfs"
-jenkins_url="http://ci.trustedfirmware.org"
+jenkins_url="${JENKINS_PUBLIC_URL}"
tfa_downloads="https://downloads.trustedfirmware.org/tf-a"
ci_env="openci"
diff --git a/openci-staging-env.sh b/openci-staging-env.sh
index 5ebe506..b6c8dae 100644
--- a/openci-staging-env.sh
+++ b/openci-staging-env.sh
@@ -10,7 +10,7 @@
#
nfs_volume="${WORKSPACE:?}/nfs"
-jenkins_url="http://ci.staging.trustedfirmware.org"
+jenkins_url="${JENKINS_PUBLIC_URL}"
tfa_downloads="https://downloads.trustedfirmware.org/tf-a"
ci_env="openci_staging"
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 4cd4f67..8856a09 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'
@@ -34,7 +34,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:
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 45a5d18..40ee15a 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
diff --git a/utils.sh b/utils.sh
index 9b6310d..9af00d3 100644
--- a/utils.sh
+++ b/utils.sh
@@ -23,11 +23,11 @@
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
source "$ci_root/openci-env.sh"
- 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
@@ -486,7 +486,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-}"
@@ -497,7 +497,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
@@ -533,7 +533,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