Fix k8s-based installer to be run on a VM in the stage3 37/10137/2 release-v9.0-start v9.0.0rc1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 17 Dec 2020 16:17:35 +0000 (17:17 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 17 Dec 2020 16:21:18 +0000 (17:21 +0100)
Change-Id: I20183be13b3b4b3af8bc5158b1beb9842654c26c
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/full_install_osm.sh

index 56ebcc1..c5d1191 100755 (executable)
@@ -402,14 +402,14 @@ function install_docker_ce() {
     echo "... restarted Docker service"
     if [ -n "${DOCKER_PROXY_URL}" ]; then
         echo "Configuring docker proxy ..."
-        if [ -f daemon.json ]; then
-            if grep -q registry-mirrors daemon.json; then
-                sudo sed -Ei 's/("registry-mirrors".*\[)(.*)\]/\1\2, \"'"${DOCKER_PROXY_URL}"'\"\]/' daemon.json
+        if [ -f /etc/docker/daemon.json ]; then
+            if grep -q registry-mirrors /etc/docker/daemon.json; then
+                sudo sed -Ei 's/("registry-mirrors".*\[)(.*)\]/\1\2, \"'"${DOCKER_PROXY_URL}"'\"\]/' /etc/docker/daemon.json
             else
-                sudo sed -i 's/{/{\n  "registry-mirrors": [\"'"${DOCKER_PROXY_URL}"'\"]",/' daemon.json
+                sudo sed -i 's/{/{\n  "registry-mirrors": [\"'"${DOCKER_PROXY_URL}"'\"]",/' /etc/docker/daemon.json
             fi
         else
-            sudo cat << EOF > daemon.json
+            sudo cat << EOF > /etc/docker/daemon.json
 {
   "registry-mirrors": ["${DOCKER_PROXY_URL}"]
 }
@@ -979,17 +979,21 @@ function parse_yaml() {
         if [ "$module" == "pla" ]; then
             if [ -n "$INSTALL_PLA" ]; then
                 echo "Updating K8s manifest file from opensourcemano\/${module}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${module}:${TAG}"
-                $WORKDIR_SUDO sed -i "s/opensourcemano\/pla:.*/${DOCKER_REGISTRY_URL}${DOCKER_USER}\/\/pla:${OSM_DOCKER_TAG}/g" ${OSM_DOCKER_WORK_DIR}/osm_pla/pla.yaml
+                $WORKDIR_SUDO sed -i "s#opensourcemano/pla:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/pla:${OSM_DOCKER_TAG}#g" ${OSM_DOCKER_WORK_DIR}/osm_pla/pla.yaml
             fi
         else
             echo "Updating K8s manifest file from opensourcemano\/${module}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${module}:${TAG}"
-            $WORKDIR_SUDO sed -i "s/opensourcemano\/${module}:.*/${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${module}:${TAG}/g" ${OSM_K8S_WORK_DIR}/${module}.yaml
+            $WORKDIR_SUDO sed -i "s#opensourcemano/${module}:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module}:${TAG}#g" ${OSM_K8S_WORK_DIR}/${module}.yaml
         fi
     done
 }
 
 function update_manifest_files() {
-    osm_services="nbi lcm ro pol mon light-ui ng-ui keystone pla"
+    if [ -n "$NGUI" ]; then
+        osm_services="nbi lcm ro pol mon ng-ui keystone pla"
+    else
+        osm_services="nbi lcm ro pol mon light-ui keystone pla"
+    fi
     list_of_services=""
     for module in $osm_services; do
         module_upper="${module^^}"
@@ -1001,7 +1005,7 @@ function update_manifest_files() {
         fi
     done
     list_of_services_to_rebuild=$(echo ${TO_REBUILD,,} |sed "s/lw-ui/light-ui/g")
-    if [ ! "$OSM_DOCKER_TAG" == "8" ]; then
+    if [ ! "$OSM_DOCKER_TAG" == "9" ]; then
         parse_yaml $OSM_DOCKER_TAG $list_of_services
     fi
     if [ -n "$MODULE_DOCKER_TAG" ]; then