From 4177c7094df0a5d637188ffa84f3d8a70223fde7 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Sat, 12 Jan 2013 01:37:06 +0000 Subject: Drop part of the release code This will go in buildbot --- (limited to 'devbot/release.py') diff --git a/devbot/release.py b/devbot/release.py deleted file mode 100644 index c82f358..0000000 --- a/devbot/release.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import subprocess -import tempfile - -upload_host = "shell.sugarlabs.org" -upload_root = "/upload/sources/sucrose/glucose" -download_uri = "http://download.sugarlabs.org/sources/sucrose/glucose" -announce_to = "sugar-devel@lists.sugarlabs.org" - - -def exists(module, filename): - release_path = os.path.join(upload_root, module.name, filename) - result = subprocess.call(["ssh", upload_host, "test", "-f", release_path]) - return result == 0 - - -def upload(module, path): - upload_path = os.path.join(upload_root, module.name) - upload_dest = "%s:%s" % (upload_host, upload_path) - return subprocess.call(["scp", path, upload_dest]) == 0 - - -def announce(module, filename, version, annotation): - fd, announce_path = tempfile.mkstemp(prefix="announce-") - - with os.fdopen(fd, "w") as f: - f.write("From: %s\n" % _get_email()) - f.write("To: %s\n" % announce_to) - f.write("Subject: [RELEASE] %s-%s\n" % (module.name, version)) - - f.write("\n%s\n" % annotation) - f.write("== Source ==\n\n") - f.write("%s/%s/%s" % (download_uri, module.name, filename)) - - result = False - - upload_dest = "%s:~" % upload_host - if subprocess.call(["scp", announce_path, upload_dest]) == 0: - announce_basename = os.path.basename(announce_path) - - if subprocess.call(["ssh", upload_host, "sendmail", "-t", - "<", announce_basename]): - result = True - - subprocess.check_call(["ssh", upload_host, "rm", announce_basename]) - - os.unlink(announce_path) - - return result - - -def _get_email(): - return subprocess.check_output(['git', 'config', 'user.email']).strip() -- cgit v0.9.1