forked from pplante/droidtowers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload-releases.py
executable file
·45 lines (34 loc) · 1.75 KB
/
upload-releases.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
37
38
39
40
41
42
43
44
#! /usr/bin/env python
import re
import sys
import semver
import requests
import json
from datetime import datetime
from getpass import getpass
from pbs import git, ant, scp, pwd, cd, ssh
def retreive_build_number():
return open('build.ver').read()
if __name__ == '__main__':
try:
releases_root = '/apps/www.happydroids.com/public/releases'
new_release_root = '%s/%s' % (releases_root, retreive_build_number())
SCP_TARGET_PATH = '[email protected]:%s' % (new_release_root,)
upload = scp.bake(i='/Users/pplante/.ssh/id_rsa', r=True, C=True, _fg=True)
remote_cmd = ssh.bake('[email protected]', i='/Users/pplante/.ssh/id_rsa', _fg=True)
remote_cmd('mkdir %s' % (new_release_root,))
upload('./out/applet/', SCP_TARGET_PATH)
upload('./out/DroidTowers.exe', '%s/DroidTowers.exe' % (SCP_TARGET_PATH,))
upload('./out/DroidTowers.zip', '%s/DroidTowers.zip' % (SCP_TARGET_PATH,))
upload('./out/android_google/android_google-release.apk', '%s/droidtowers-google.apk' % (SCP_TARGET_PATH,))
upload('./out/android_amazon/android_amazon-release.apk', '%s/droidtowers-amazon.apk' % (SCP_TARGET_PATH,))
remote_cmd('rm %s/current' % (releases_root,))
remote_cmd('ln -s %s %s/current' % (new_release_root, releases_root,))
print "http://www.happydroids.com/releases/current/DroidTowers.exe"
print "http://www.happydroids.com/releases/current/DroidTowers.zip"
# print "http://www.happydroids.com/releases/current/DroidTowers.jar"
print "http://www.happydroids.com/releases/current/droidtowers-google.apk"
print "http://www.happydroids.com/releases/current/droidtowers-amazon.apk"
except Exception, e:
print e
sys.exit(1)