From aa98a8d64adb0379b5845fde6e7b886679226b0d Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Sat, 9 Nov 2013 11:51:39 +0000 Subject: [PATCH] Write buildserver ID to buildserver on creation The ID of the buildserver is just the corresponding commit hash in fdroidserver at the point where it was built, which should be enough to uniquely identify a version of it. The idea is that this will ultimately end up as metadata in an apk, such that its precise lineage can be traced, and the exact same binary can be reproduced. --- makebuildserver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/makebuildserver.py b/makebuildserver.py index fa37bca5..d93fd8f0 100755 --- a/makebuildserver.py +++ b/makebuildserver.py @@ -163,6 +163,16 @@ with open(os.path.join(serverdir, 'up.log'), 'w') as log: if returncode != 0: print "Failed to configure server" sys.exit(1) + +print "Writing buildserver ID" +p = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE) +buildserverid = p.communicate()[0].strip() +print "...ID is " + buildserverid +subprocess.call( + ['vagrant', 'ssh', '-c', 'sh -c "echo {0} >/home/vagrant/buildserverid"' + .format(buildserverid)], + cwd=serverdir) + print "Stopping build server VM" vagrant(['halt'], serverdir)