utils.sh: tidy up the script
Using "tf-a-<TF-A_LTS_BRANCH>" to change the download space
for the LTS branch
Change-Id: I4d6e7ff1f0ab406ef83e77f4bea4ca8fbdb1e3b8
Signed-off-by: Arthur She <arthur.she@linaro.org>
(cherry picked from commit 2c9ca72a1f20d8ce437943b7e6f0f8c9b987ed09)
diff --git a/openci-env.sh b/openci-env.sh
index edaa68c..26cd707 100644
--- a/openci-env.sh
+++ b/openci-env.sh
@@ -13,3 +13,14 @@
jenkins_url="http://ci.trustedfirmware.org"
tfa_downloads="https://downloads.trustedfirmware.org/tf-a"
ci_env="openci"
+
+tfa_branch=${TF_GERRIT_BRANCH##*/}
+if echo $tfa_branch | grep -q "^lts-v"; then
+ # LTS branch, change the download space to the respective one
+ tfa_downloads="https://downloads.trustedfirmware.org/tf-a-$tfa_branch"
+fi
+
+echo "*************************************"
+echo "ci_env: $ci_env"
+echo "tfa_downloads: $tfa_downloads"
+echo "*************************************"
diff --git a/openci-lts-v2.10-env.sh b/openci-lts-v2.10-env.sh
deleted file mode 100644
index 9353726..0000000
--- a/openci-lts-v2.10-env.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright (c) 2024, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-
-#
-# Environmental settings for the OpenCI LTS v2.10 infrastructure.
-#
-
-nfs_volume="${WORKSPACE:?}/nfs"
-jenkins_url="http://ci.trustedfirmware.org"
-tfa_downloads="https://downloads.trustedfirmware.org/tf-a-lts-v2.10"
diff --git a/openci-lts-v2.8-env.sh b/openci-lts-v2.8-env.sh
deleted file mode 100644
index 58e14ed..0000000
--- a/openci-lts-v2.8-env.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright (c) 2023, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-
-#
-# Environmental settings for the OpenCI staging infrastructure.
-#
-
-nfs_volume="${WORKSPACE:?}/nfs"
-jenkins_url="http://ci.trustedfirmware.org"
-tfa_downloads="https://downloads.trustedfirmware.org/tf-a-lts-v2.8"
diff --git a/openci-staging-env.sh b/openci-staging-env.sh
index e64c8e4..5ebe506 100644
--- a/openci-staging-env.sh
+++ b/openci-staging-env.sh
@@ -13,3 +13,15 @@
jenkins_url="http://ci.staging.trustedfirmware.org"
tfa_downloads="https://downloads.trustedfirmware.org/tf-a"
ci_env="openci_staging"
+
+tfa_branch=${TF_GERRIT_BRANCH##*/}
+if echo $tfa_branch | grep -q "^lts-v"; then
+ # LTS branch, change the download space to the respective one
+ tfa_downloads="https://downloads.trustedfirmware.org/tf-a-$tfa_branch"
+fi
+
+echo "*************************************"
+echo "ci_env: $ci_env"
+echo "tfa_downloads: $tfa_downloads"
+echo "*************************************"
+
diff --git a/utils.sh b/utils.sh
index b830390..9b6310d 100644
--- a/utils.sh
+++ b/utils.sh
@@ -26,13 +26,7 @@
if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
source "$ci_root/arm-env.sh"
elif echo "$JENKINS_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"
- elif echo "$TF_GERRIT_BRANCH" | grep -q "lts-v2.10"; then
- source "$ci_root/openci-lts-v2.10-env.sh"
- else
- source "$ci_root/openci-env.sh"
- fi
+ source "$ci_root/openci-env.sh"
elif echo "$JENKINS_URL" | grep -q "ci.staging.trustedfirmware.org"; then
source "$ci_root/openci-staging-env.sh"
fi