From bb8464bbdea250efc9e5da70d067427896187561 Mon Sep 17 00:00:00 2001 From: tux3 Date: Wed, 25 Feb 2015 16:16:18 +0100 Subject: [PATCH] Upload update FTP deployement scripts In case someone finds those interesting, or if I get hit by a bus unexpectedly --- tools/update-server/deployUpdateFTP_32.py | 35 +++++++++++++++++++++++ tools/update-server/deployUpdateFTP_64.py | 35 +++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tools/update-server/deployUpdateFTP_32.py create mode 100644 tools/update-server/deployUpdateFTP_64.py diff --git a/tools/update-server/deployUpdateFTP_32.py b/tools/update-server/deployUpdateFTP_32.py new file mode 100644 index 000000000..6a98abd35 --- /dev/null +++ b/tools/update-server/deployUpdateFTP_32.py @@ -0,0 +1,35 @@ +#!/usr/bin/python2.7 + +# This script deploys a qTox update to an FTP server. +# Pass the path to the root of the local update server as argument, no spaces allowed + +import sys +import os + +target = 'win32' +prefix = '/qtox/'+target+'/' +uploadcmd1 = "bash -c '"+'ftp -n tux3-dev.tox.im 0<<<"`echo -ne "user qtox-win-update-upload INSERT-PASSWORD-HERE\ncd '+target+'\nsend ' +uploadcmd2 = '\n"`"'+"'" + +def upload(file, rfile): + #print(uploadcmd1+file+' '+rfile+uploadcmd2) + os.system(uploadcmd1+file+' '+rfile+uploadcmd2) + +# Check our local folders +if (len(sys.argv) < 2): + print("ERROR: Needs the path to the local update server in argument") + sys.exit(1) + +localpath = sys.argv[1]; + +# Upload files/ +filenames = next(os.walk(localpath+prefix+'/files/'))[2] +for filename in filenames: + print("Uploading files/"+filename+'...') + upload(localpath+prefix+'/files/'+filename, 'files/'+filename) + +# Upload version and flist +print("Uploading flist...") +upload(localpath+prefix+'flist', 'flist') +print("Uploading version...") +upload(localpath+prefix+'version', 'version') diff --git a/tools/update-server/deployUpdateFTP_64.py b/tools/update-server/deployUpdateFTP_64.py new file mode 100644 index 000000000..efbfc873b --- /dev/null +++ b/tools/update-server/deployUpdateFTP_64.py @@ -0,0 +1,35 @@ +#!/usr/bin/python2.7 + +# This script deploys a qTox update to an FTP server. +# Pass the path to the root of the local update server as argument, no spaces allowed + +import sys +import os + +target = 'win64' +prefix = '/qtox/'+target+'/' +uploadcmd1 = "bash -c '"+'ftp -n tux3-dev.tox.im 0<<<"`echo -ne "user qtox-win-update-upload INSERT-PASSWORD-HERE\ncd '+target+'\nsend ' +uploadcmd2 = '\n"`"'+"'" + +def upload(file, rfile): + #print(uploadcmd1+file+' '+rfile+uploadcmd2) + os.system(uploadcmd1+file+' '+rfile+uploadcmd2) + +# Check our local folders +if (len(sys.argv) < 2): + print("ERROR: Needs the path to the local update server in argument") + sys.exit(1) + +localpath = sys.argv[1]; + +# Upload files/ +filenames = next(os.walk(localpath+prefix+'/files/'))[2] +for filename in filenames: + print("Uploading files/"+filename+'...') + upload(localpath+prefix+'/files/'+filename, 'files/'+filename) + +# Upload version and flist +print("Uploading flist...") +upload(localpath+prefix+'flist', 'flist') +print("Uploading version...") +upload(localpath+prefix+'version', 'version')