Switch to side-by-side view

--- a/scripts/functions.sh
+++ b/scripts/functions.sh
@@ -5,17 +5,21 @@
 COL_GREEN='\e[0;92m'
 COL_RED='\e[41m'
 
-DOCKER="docker run --rm --dns=192.168.0.11"
+#DNS="--dns=192.168.0.11"
+DNS=""
+
+DOCKER="docker run --rm ${DNS}"
 if $(groups|grep -qvw docker); then
   # We are not in the docker group, checking if we are sudoers
   sudo -n true
   if [ $? == 0 ]; then
-    DOCKER="sudo docker run --rm --dns=192.168.0.11"
+    DOCKER="sudo docker run --rm ${DNS}"
   else
     echo "Not able to execute docker"
     exit -1
   fi
 fi
+
 DEV_DOCKER_IMAGE="c2netproject.eu/runtime/java/dev:1_0_0"
 MARIA_DOCKER_IMAGE="eslap.cloud/runtime/mariadb:1_0_0"
 NPMINSTALL="
@@ -93,6 +97,7 @@
   if ( [ ${prepare} != "skip-copy-src" ] && [ ${prepare} != "copy-src" ] \
    && [ ${prepare} != "copy-src" ] && [ ${prepare} != "copy-src-pubsub" ] \
    && [ ${prepare} != "copy-src-ucp" ] && [ ${prepare} != "unzip-ucp" ]  \
+   && [ ${prepare} != "copy-all" ]   && [ ${prepare} != "copy-src-import-alg-julia" ]  \
    && [ ${prepare} != "copy-src-import-alg" ]  && [ ${prepare} != "copy-src-dkms" ] )
   then
     echoError "Invalid prepare action $prepare"
@@ -155,6 +160,13 @@
     rsync -avq --include="Manifest.json" --include="code" --exclude="node_modules"  --exclude="test*" --exclude=".*" ${componentSrc} ${COMPONENTS_HOME}/
     echoBlue "$ComponentName Copied to Components Bundle"
 
+  # Copy ALL in component, to avoid to recompile again
+  elif [ ${prepare} = "copy-all" ]
+  then
+    sudo rm -rf ${ComponentPath} || true
+    rsync -avq --include="Manifest.json" --include="code"  --exclude="test*" --exclude=".*" ${componentSrc} ${COMPONENTS_HOME}/
+    echoBlue "$ComponentName Copied to Components Bundle with node_modules"
+
   # Special case for pubsub, todo change this
   elif [ ${prepare} = "copy-src-pubsub" ]
   then
@@ -179,12 +191,21 @@
     echoBlue "$ComponentName Copied to Components Bundle"
 
   # Special case for task executor
-  elif [ ${prepare} = "copy-src-import-alg" ]
-  then
-    # check if directory exists
+  elif [ ${prepare} = "copy-src-import-alg-julia" ]
+  then
+    if [ ! -d "$componentSrc/scripts" ]; then
+      echoError "Folder NOT FOUND $componentSrc/scripts "
+      exit 1
+    fi
     origin=$PWD
-#    ${componentSrc}/scripts/build_julia_image.sh
-    ${componentSrc}/scripts/import_algorithms.sh false
+
+    echoGreen "$ComponentName Copying algorithms"
+    cd ${componentSrc}/scripts
+    ./import_algorithms.sh
+
+    echoGreen "$ComponentName Building Julia image  "
+    cd ${componentSrc}/scripts
+    ./build_julia_image.sh
     echoBlue "$ComponentName Optimization Algorithms imported"
 
     cd ${origin}
@@ -192,6 +213,22 @@
     rsync -avq --include="Manifest.json" --include="code" --exclude="node_modules"  --exclude="test*" --exclude=".*" --exclude="resources" ${componentSrc} ${COMPONENTS_HOME}/
     echoBlue "$ComponentName Copied to Components Bundle"
 
+ # Special case for task executor
+  elif [ ${prepare} = "copy-src-import-alg" ]
+  then
+    if [ ! -d "$componentSrc/scripts" ]; then
+      echoError "Folder NOT FOUND $componentSrc/scripts "
+      exit 1
+    fi
+    origin=$PWD
+    cd ${componentSrc}/scripts
+    ./import_algorithms.sh
+    echoBlue "$ComponentName Optimization Algorithms imported"
+
+    cd ${origin}
+    sudo rm -rf ${ComponentPath} || true
+    rsync -avq --include="Manifest.json" --include="code" --exclude="node_modules"  --exclude="test*" --exclude=".*" --exclude="resources" ${componentSrc} ${COMPONENTS_HOME}/
+    echoBlue "$ComponentName Copied to Components Bundle"
 
   fi
 }