full_install_osm.sh: backup previous env files before generating/updating them 48/8048/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 16 Oct 2019 07:33:35 +0000 (09:33 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 16 Oct 2019 07:33:35 +0000 (09:33 +0200)
Change-Id: I79a21f4a83ee54c513caceefecbf34f69b4effa4
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/full_install_osm.sh

index 047a84f..7fb9587 100755 (executable)
@@ -747,15 +747,26 @@ function cmp_overwrite() {
     fi
 }
 
-function generate_config_log_folders() {
-    echo "Generating config and log folders"
-    $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/docker-compose.yaml $OSM_DOCKER_WORK_DIR/docker-compose.yaml
-    $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/prometheus.yml $OSM_DOCKER_WORK_DIR/prometheus.yml
-    echo "Finished generation of config and log folders"
-}
 
 function generate_docker_env_files() {
+    echo "Doing a backup of existing env files"
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/keystone-db.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/keystone.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/lcm.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/lwui.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/mon.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/nbi.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/pol.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/ro-db.env{,~}
+    $WORKDIR_SUDO cp $OSM_DOCKER_WORK_DIR/ro.env{,~}
+
     echo "Generating docker env files"
+    # Docker-compose
+    $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/docker-compose.yaml $OSM_DOCKER_WORK_DIR/docker-compose.yaml
+
+    # Prometheus
+    $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/prometheus.yml $OSM_DOCKER_WORK_DIR/prometheus.yml
+
     # LCM
     if [ ! -f $OSM_DOCKER_WORK_DIR/lcm.env ]; then
         echo "OSMLCM_DATABASE_COMMONKEY=${OSM_DATABASE_COMMONKEY}" | $WORKDIR_SUDO tee -a $OSM_DOCKER_WORK_DIR/lcm.env
@@ -1049,7 +1060,6 @@ function install_lightweight() {
     [ -z "$DOCKER_NOBUILD" ] && generate_docker_images
     track docker_build
     generate_docker_env_files
-    generate_config_log_folders
 
     # remove old stack
     remove_stack $OSM_STACK_NAME