From a419c7b6e8457ad10a72c406c09822c568ff5b9f Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Thu, 11 Apr 2024 16:22:23 +0000
Subject: [PATCH] Deploy scripts:

- Corrected deployment order in my_deploy.sh for opticalcontroller and service components
---
 my_deploy.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/my_deploy.sh b/my_deploy.sh
index 7dd5e5c3e..4e705622b 100755
--- a/my_deploy.sh
+++ b/my_deploy.sh
@@ -29,7 +29,14 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_gene
 #export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker"
 
 # Uncomment to activate Optical Controller
-#export TFS_COMPONENTS="${TFS_COMPONENTS} opticalcontroller"
+#   To manage optical connections, "service" requires "opticalcontroller" to be deployed
+#   before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the
+#   "opticalcontroller" only if "service" is already in TFS_COMPONENTS, and re-export it.
+#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then
+#    BEFORE="${TFS_COMPONENTS% service*}"
+#    AFTER="${TFS_COMPONENTS#* service}"
+#    export TFS_COMPONENTS="${BEFORE} opticalcontroller service ${AFTER}"
+#fi
 
 # Uncomment to activate ZTP
 #export TFS_COMPONENTS="${TFS_COMPONENTS} ztp"
-- 
GitLab