summaryrefslogtreecommitdiff
path: root/template.update.py
blob: 62bc1bc018b9dfee46a7aa2a5db0cb329bbdb2fa (plain) (blame)
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
#!/usr/bin/python2.7
print("git diff --name-status previous HEAD > x.diff")

f=open("x.diff", "r")
xdiff=[]

for l in f:
    xdiff.append(l.replace('\n', '').replace('M\t','').replace('A\t',''))

f.close()


f=open("deployupdate.sh", "w");
for i in xdiff:
    a=i.split('/')
    #print str(a)
    path="/"
    #print str(a[:-1])
    path=path.join( a[:-1] )
    #print path
    f.write("scp -4 -P 22 %s username@tmw2.org:/home/username/serverdata/%s/%s\n" % (i, path, a[len(a)-1]))

#f.write("\ncd ..\n")
f.close()

print("To deploy update, please run: ./deployupdate.sh");