Update script to pull all docker images 51/59251/2
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>
Mon, 6 Aug 2018 17:15:04 +0000 (13:15 -0400)
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>
Mon, 6 Aug 2018 17:33:17 +0000 (13:33 -0400)
Remove configuration update, add in all new SO images, Configuration is
now controlled by override.yaml files.  We no longer need to use the
JSON substitution

Issue-ID: SO-803

Change-Id: I960b10e71420268621cd5fee3061ec2af01a087d
Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
deploy.sh
json_updater.py [deleted file]

index 7cbcbe5..d5ce4f0 100755 (executable)
--- a/deploy.sh
+++ b/deploy.sh
@@ -79,16 +79,6 @@ function container_name() {
     echo ${BASE}_${SERVICE}_1
 }
 
-function update_json_config() {
-    if [ -n "$MSO_CONFIG_UPDATES" ];
-    then   
-        chmod u+x $SCRIPT_DIR/json_updater.py
-        echo $MSO_CONFIG_UPDATES | $SCRIPT_DIR/json_updater.py $SCRIPT_DIR/volumes/mso/chef-config/mso-docker.json
-        echo "MSO docker JSON updated"
-    fi
-    
-}
-
 function pull_docker_images() {
     echo "Using Nexus for MSO: $NEXUS_DOCKER_REPO_MSO (user "$NEXUS_USERNAME_MSO")"
     # login to nexus
@@ -96,8 +86,29 @@ function pull_docker_images() {
     $DOCKER_CMD login -u $NEXUS_USERNAME_MARIADB -p $NEXUS_PASSWD_MARIADB $NEXUS_DOCKER_REPO_MARIADB
     
     # get images
-    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/openecomp/mso:$MSO_DOCKER_IMAGE_VERSION
-    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/openecomp/mso:$MSO_DOCKER_IMAGE_VERSION openecomp/mso:latest
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/api-handler-infra:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/api-handler-infra:$MSO_DOCKER_IMAGE_VERSION so/api-handler-infra:latest
+    
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/bpmn-infra:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/bpmn-infra:$MSO_DOCKER_IMAGE_VERSION so/bpmn-infra:latest
+    
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/asdc-controller:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/asdc-controller:$MSO_DOCKER_IMAGE_VERSION so/asdc-controller:latest
+    
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/vfc-adapter:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/vfc-adapter:$MSO_DOCKER_IMAGE_VERSION so/vfc-adapter:latest
+        
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/openstack-adapter:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/openstack-adapter:$MSO_DOCKER_IMAGE_VERSION so/openstack-adapter:latest
+    
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/catalog-db-adapter:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/catalog-db-adapter:$MSO_DOCKER_IMAGE_VERSION so/catalog-db-adapter:latest
+    
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/request-db-adapter:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/request-db-adapter:$MSO_DOCKER_IMAGE_VERSION so/request-db-adapter:latest
+    
+    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/so/sdnc-adapter:$MSO_DOCKER_IMAGE_VERSION
+    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/so/sdnc-adapter:$MSO_DOCKER_IMAGE_VERSION so/sdnc-adapter:latest
     
     echo "Using Nexus for MARIADB: $NEXUS_DOCKER_REPO_MARIADB (user "$NEXUS_USERNAME_MARIADB")"
     $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MARIADB/mariadb:10.1.11
@@ -130,7 +141,6 @@ function wait_for_mariadb() {
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 init_docker_command
-update_json_config
 if [ $NEXUS -eq 1 ]; then
     pull_docker_images
 fi
diff --git a/json_updater.py b/json_updater.py
deleted file mode 100644 (file)
index 17841fe..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python3
-import json
-import os
-import sys
-
-#chef_update_string = '{"default_attributes": {"asdc-connections": {"asdc-controller1": {"environmentName": "test"}}}}'
-#json_file_to_update="./volumes/mso/chef-config/mso-docker.json"
-
-def usage():
-    print('Usage:')
-    print("    echo <json> | %s <file> " % ( sys.argv[0], ))
-    print()
-    print("file\tpath of the valid json file to update")
-    print("json\ta json string containing the values to update in <file>")
-    print("")
-    print("Example : ")
-    print(""" 
-    echo '{"default_attributes": {"asdc-connections": {"asdc-controller1": {"environmentName": "test"}}}}' | %s ./volumes/mso/chef-config/mso-docker.json
-    """ % (sys.argv[0]))
-
-    
-if len(sys.argv) < 2:
-    usage()
-    exit(1)
-    
-if sys.argv[1] in ('--help','-h'):
-    usage()
-    exit(0)
-    
-# get updates
-updates_json = sys.stdin.read()
-print(updates_json[81:])
-updates = json.loads(updates_json)
-
-# get file to update
-json_file_to_update = sys.argv[1]
-with open(json_file_to_update) as f:
-    to_update = json.load(f)
-    
-# update config with updates
-def update(config, updates):
-    #assert isinstance(config, dict)
-    #assert isinstance(updates, dict)
-
-    # if key is a simple type, update it. Otherwise, update sub values
-
-
-    for update_key,update_value in updates.items():
-        if update_key not in config:
-            raise Exception('Incorrect parameter : %s' % (update_key,))        
-        if isinstance(update_value, (int, str)):
-            config[update_key] = update_value
-        elif isinstance (update_value,list) and isinstance (config[update_key],list):
-            config[update_key] = update_value
-        else:
-            update(config[update_key], update_value)
-
-update(to_update, updates)
-
-# replace the file
-tmp_file = '%s.tmp' % (json_file_to_update,)
-with open(tmp_file, 'w') as f:
-    json.dump(to_update, f,  sort_keys=True, indent=2)
-os.rename(tmp_file, json_file_to_update)
-