forked from pyrpl-fpga/pyrpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.deploy_to_sourceforge.py
29 lines (26 loc) · 1.22 KB
/
.deploy_to_sourceforge.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
import sys
import os
from pyrpl import sshshell, __version__
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: python .deploy_to_sourceforge.py file1 [file2] ...")
pw = os.environ['PYPI_PSW']
ssh = sshshell.SshShell(hostname='frs.sourceforge.net',
user='lneuhaus',
password=pw,
shell=False)
for filename in sys.argv[1:]:
for destpath in ['/home/frs/project/pyrpl/',
'/home/frs/project/pyrpl/%s/' % __version__
]:
print("Uploading file '%s' to '%s' on sourceforge..." % (filename, destpath))
try:
ssh.scp.put(filename, destpath)
except BaseException as e:
print("Upload of file '%s' to '%s' to sourceforge failed: %s!" % (filename, destpath, e))
ssh = sshshell.SshShell(hostname='frs.sourceforge.net',
user='lneuhaus',
password=pw,
shell=False)
else:
print("Finished upload of file '%s' to '%s' on sourceforge!" % (filename, destpath))