summaryrefslogtreecommitdiff
path: root/ostree-repo-server
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-03 11:01:32 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-19 10:55:14 +0000
commit7338cbc2bc798088449a3512c691aaa381041d5b (patch)
tree2aa8b64e667c150695f98f89ffb226bc76d04b55 /ostree-repo-server
parent1ce0979ad55262f295e4ad84e59fa70b330dabcf (diff)
downloadmorph-7338cbc2bc798088449a3512c691aaa381041d5b.tar.gz
yarns: Make the distbuild yarn expose the worker's artifact cache over HTTP
OSTree can easily pull over HTTP. All that is necessary is to expose the repo directory. This commit adds a simple HTTP server to do this in the test suite. Actual implementations should use something better, like lighttpd. Also add some logging of the cache servers in this yarn to help debug.
Diffstat (limited to 'ostree-repo-server')
-rwxr-xr-xostree-repo-server15
1 files changed, 15 insertions, 0 deletions
diff --git a/ostree-repo-server b/ostree-repo-server
new file mode 100755
index 00000000..e6dc4a56
--- /dev/null
+++ b/ostree-repo-server
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+
+from BaseHTTPServer import HTTPServer
+from SimpleHTTPServer import SimpleHTTPRequestHandler
+from SocketServer import ThreadingMixIn
+
+class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
+ """Handle requests in a separate thread"""
+
+handler = SimpleHTTPRequestHandler
+handler.protocol_version="HTTP/1.0"
+server_address = ('', 12324)
+
+httpd = ThreadedHTTPServer(server_address, handler)
+httpd.serve_forever()