MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / DeployJava

Function DeployJava

tools/deploy.py:83–103  ·  view source on GitHub ↗
(host, path, source_file, teardown)

Source from the content-addressed store, hash-verified

81 return True
82
83def DeployJava(host, path, source_file, teardown):
84 (prefix, suffix, is_local) = GetPrefixAndSuffix(host)
85 cmd_arr = []
86 file_name = os.path.basename(source_file)
87 if teardown:
88 print("clear java on {}. path: {}".format(host, path))
89 cmd_arr.append("{} cd {}; rm {}; rm -rf {} {}".format(prefix, path, file_name, "jdk1.8.0_121", suffix))
90 else:
91 print("deploy java on {}. path: {}".format(host, path))
92 cmd_arr.append("{} mkdir -p {} {}".format(prefix, path, suffix))
93 if is_local:
94 cmd_arr.append("cp {} {}".format(source_file, path))
95 else:
96 cmd_arr.append("scp {} {}:{}".format(source_file, host, path))
97 cmd_arr.append("{} cd {}; tar -zxvf {}; {}".format(prefix, path, file_name, suffix))
98 for cmd in cmd_arr:
99 (returncode,output,errout) = RunWithRetunCode(cmd)
100 if returncode != 0:
101 print("execute cmd[{}] failed! error msg: {}".format(cmd, errout))
102 return
103 print("execute cmd[{}] success".format(cmd))
104
105
106def DeployZookeeper(zk_conf, teardown):

Callers 1

DeployZookeeperFunction · 0.85

Calls 3

GetPrefixAndSuffixFunction · 0.85
RunWithRetunCodeFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected