Clone missing iec repo if not found 24/3624/2
authorCiprian Barbu <ciprian.barbu@enea.com>
Thu, 16 Jul 2020 06:20:15 +0000 (09:20 +0300)
committerCiprian Barbu <ciprian.barbu@enea.com>
Mon, 3 Aug 2020 12:16:45 +0000 (15:16 +0300)
Make sure iec repo is present for rec clusters.

At the same time, make sure K8S_MASTER_IP is exported in the ssh session
shell when running the install script

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

jjb/shell/seba_on_arm.sh

index c695f92..1938947 100755 (executable)
@@ -71,6 +71,15 @@ case "${JOB_NAME}" in
     IEC_DIR="/var/lib/akraino/iec"
     KUBE_DIR="~${K8S_SSH_USER}/.kube"
     UPSTREAM_PROJECT='rec'
     IEC_DIR="/var/lib/akraino/iec"
     KUBE_DIR="~${K8S_SSH_USER}/.kube"
     UPSTREAM_PROJECT='rec'
+    # The REC cluster do not have a clone of the iec repo
+    IEC_REPO="https://gerrit.akraino.org/r/iec.git"
+    IEC_DIR="~${CLUSTER_SSH_USER}/iec"
+    IEC_CLONE_CMD="'if ! [ -d "$IEC_DIR" ];\
+                    then\
+                      mkdir -p $IEC_DIR;\
+                      git clone $IEC_REPO $IEC_DIR;
+                    fi'"
+    run_on_k8s_master ssh "${IEC_CLONE_CMD}"
     ;;
   *)
     echo "Cannot determine installer from ${JOB_NAME}"
     ;;
   *)
     echo "Cannot determine installer from ${JOB_NAME}"
@@ -86,9 +95,10 @@ fi
 
 export K8S_MASTER_IP UPSTREAM_PROJECT="${UPSTREAM_PROJECT:-${PROJECT}}"
 
 
 export K8S_MASTER_IP UPSTREAM_PROJECT="${UPSTREAM_PROJECT:-${PROJECT}}"
 
+
 case "${JOB_NAME}" in
   *-install-seba_on_arm*)
 case "${JOB_NAME}" in
   *-install-seba_on_arm*)
-    INSTALL_CMD="'cd ${IEC_DIR}/src/use_cases/seba_on_arm/install; ./install.sh ${UPSTREAM_PROJECT}'"
+    INSTALL_CMD="'cd ${IEC_DIR}/src/use_cases/seba_on_arm/install; K8S_MASTER_IP=${K8S_MASTER_IP} ./install.sh ${UPSTREAM_PROJECT}'"
     run_on_k8s_master ssh "${INSTALL_CMD}"
     ;;
   *-test-seba_on_arm*)
     run_on_k8s_master ssh "${INSTALL_CMD}"
     ;;
   *-test-seba_on_arm*)