def main():
	if len(sys.argv) < 3:
		print "Usage: %s <version> [mobilesdk-XXX.zip, ..]" % sys.argv[0]
		sys.exit(1)

	version = sys.argv[1]
	mobilesdk_zips = sys.argv[2:]

	cfg = utils.get_build_config()
	if not cfg.verify_aws():
		print "Error: Need both AWS_KEY and AWS_SECRET in the environment or config.json"
		sys.exit(1)

	global bucket
	bucket = cfg.open_bucket()
	upload_release(version, mobilesdk_zips)
示例#2
0
#!/usr/bin/python
import sys, os, socket, utils
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import simplejson

if len(sys.argv) != 6:
	print "Usage: %s <desktop|mobile> <path> <branch> <revision> <build url>" % sys.argv[0]
	sys.exit(1)

(type, path, branch, revision, build_url) = sys.argv[1:]

cfg = utils.get_build_config()
if not cfg.verify_aws():
	print "Error: Need both AWS_KEY and AWS_SECRET in the environment or config.json"
	sys.exit(1)
	
bucket = cfg.open_bucket()

sha1 = utils.shasum(path)
filename = os.path.basename(path)
filesize = os.path.getsize(path)

print 'uploading %s (branch %s / revision %s)...' % (filename, branch, revision)
key = Key(bucket)
key.key = '%s/%s/%s' % (type, branch, filename)
key.set_metadata('git_revision', revision)
key.set_metadata('git_branch', branch)
key.set_metadata('build_url', build_url)
key.set_metadata('build_type', type)
key.set_metadata('sha1', sha1)