SEBA: add UPSTREAM_PROJECT parameter to install.sh 85/3585/4
authorCiprian Barbu <ciprian.barbu@enea.com>
Thu, 18 Jun 2020 14:31:58 +0000 (17:31 +0300)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 23 Jun 2020 13:44:27 +0000 (13:44 +0000)
This allows us to handle SEBA install.sh differently for IEC and REC,
given that support for REC will soon be added.

Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com>
Change-Id: Ie37597a7b0a7b4691ccfcb7dd44a53f6e42462bf

src/use_cases/seba_on_arm/test/ponsim/install.sh

index b6baf61..e7a0d0a 100755 (executable)
@@ -4,12 +4,33 @@
 set -ex
 
 basepath="$(cd "$(dirname "$(readlink -f "$0")")"; pwd)"
+
 IEC_PATH="$(readlink -f "$(git -C "${basepath}" rev-parse --show-toplevel)")"
 HELM_CHARTS_PATH="src/use_cases/seba_on_arm/src_repo/helm-charts"
+HELM_CHARTS_REV_IEC="cord-7.0-arm64"
+HELM_CHARTS_REV_REC="cord-7.0-arm64-rec"
+UPSTREAM_PROJECT="${UPSTREAM_PROJECT:-iec}"
+
+if [ "$#" -gt 0 ]; then UPSTREAM_PROJECT="$1"; fi
+
+case "${UPSTREAM_PROJECT}" in
+  "iec")
+    HELM_CHARTS_REV="${HELM_CHARTS_REV_IEC}"
+    ;;
+  "rec")
+    HELM_CHARTS_REV="${HELM_CHARTS_REV_REC}"
+    ;;
+  *)
+    echo "Invalid upstream project ${UPSTREAM_PROJECT}"
+    echo "  Specify either iec or rec"
+    exit 1
+    ;;
+esac
 
 export M="/tmp/milestones"
 export SEBAVALUE=
 export WORKSPACE="${HOME}"
+export HELM_CHARTS_REV
 
 # Using opencord automation-tools from the cord-6.1 maintenance branch
 AUTO_TOOLS="${WORKSPACE}/automation-tools"
@@ -22,6 +43,7 @@ mkdir -p "${M}" "${WORKSPACE}/cord/test"
 # Update helm-charts submdule needed later
 # ignore subproject commit and use latest remote version
 git -C "${IEC_PATH}" submodule update --init --remote "${HELM_CHARTS_PATH}"
+git -C "${IEC_PATH}/${HELM_CHARTS_PATH}" checkout "${HELM_CHARTS_REV}"
 
 test -d "${AUTO_TOOLS}" || git clone "${AUTO_TOOLS_REPO}" "${AUTO_TOOLS}"
 git -C "${AUTO_TOOLS}" checkout "${AUTO_TOOLS_REV}"