aboutsummaryrefslogtreecommitdiffstats
path: root/docker_upgrade_scripts/fabfile.py
diff options
context:
space:
mode:
authorkranthi guttikonda <kranthi.guttikonda9@gmail.com>2017-10-12 12:24:51 -0400
committerkranthi guttikonda <kranthi.guttikonda9@gmail.com>2017-10-12 13:38:03 -0400
commit905b71b4fc72c7c091d9bd3dd616b951c75556fa (patch)
treef543865ac5a52af246b700c961cac9db5825835b /docker_upgrade_scripts/fabfile.py
parentbf58a19263620322eb8308826728aa4f91f79eb1 (diff)
Initial scripts to upgrade docker ONAP component
Initial scripts to upgrade docker containers in each component. Script will login to each vm and run vm_init.sh based on component Issue-ID: INT-269 Change-Id: I8453a401a8a2d1f94f34424bba915c176fbcee2d Signed-off-by: kranthi guttikonda <kranthi.guttikonda9@gmail.com>
Diffstat (limited to 'docker_upgrade_scripts/fabfile.py')
-rwxr-xr-xdocker_upgrade_scripts/fabfile.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/docker_upgrade_scripts/fabfile.py b/docker_upgrade_scripts/fabfile.py
new file mode 100755
index 00000000..72e3e61a
--- /dev/null
+++ b/docker_upgrade_scripts/fabfile.py
@@ -0,0 +1,32 @@
+from fabric.api import *
+from fabric.context_managers import *
+
+def uptime():
+ res = run('cat /proc/uptime')
+ print res
+
+def host_type():
+ run('uname -s')
+
+def upgrade_docker(server_name, my_env):
+ server_name=server_name.split("-")[1]
+ if server_name in "message-router":
+ execute_file = "/opt/mr_vm_init.sh"
+ elif server_name in "dcae-controller":
+ execute_file = "/opt/dcae2_vm_init.sh"
+ elif server_name in "openo-server":
+ execute_file = "/opt/openo_all_serv.sh"
+ elif server_name in "dns":
+ execute_file = None
+ else:
+ execute_file = "/opt/" + server_name + "_vm_init.sh"
+ print "Executing file %s" % execute_file
+ if execute_file:
+ with settings( warn_only=True, key_filename=my_env['key_filename'], user=my_env['user']):
+ sudo(execute_file)
+
+def health_checks_robot(my_env):
+ with settings( warn_only=True, key_filename=my_env['key_filename'], user=my_env['user']):
+ with cd('/opt'):
+ sudo('./ete.sh health')
+