forked from vmware-archive/retail-demo-xd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.py
executable file
·36 lines (28 loc) · 1.16 KB
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
import sys
import commands
import config
def shellcmd(cmd):
(status, output) = commands.getstatusoutput(cmd)
print output
print "Command Ran: " + cmd
def main():
args = sys.argv[1:]
if len(args) > 0:
if args[0].startswith("-") or args[0].startswith("h"):
print """
Before running this script, specify demo config properties in config.py.
This install script will attempt to copy files to a local Spring XD instance
and scp files to remote VMs. This script only works on mac or linux.
"""
else:
scp_to_phd = "scp ./phd_demo.py %s@%s:/home/%s/demo.py" % (config.phd_username, config.phd_hostname, config.phd_username)
shellcmd(scp_to_phd)
scp_to_sqlf = "scp ./sqlf_demo.py %s@%s:/home/%s/demo.py" % (config.sqlf_username, config.sqlf_hostname, config.sqlf_username)
shellcmd(scp_to_sqlf)
scp_to_sqlf2 = "scp ./config.py %s@%s:/home/%s/config.py" % (config.sqlf_username, config.sqlf_hostname, config.sqlf_username)
shellcmd(scp_to_sqlf2)
cp_to_xd = "cp -r ./springxd_files/* %s/xd" % (config.springxd_home)
shellcmd(cp_to_xd)
if __name__ == "__main__":
main()