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-04-10 13:52:26 +0000
commitce74ccdddae469cd6b9ebe88f35c402310cacce1 (patch)
tree00e84c4489c1e571904ea7e470c499f2c9971c35 /ostree-repo-server
parent6ad1ecf530e34612a59e548eb08a58b7e92e05b3 (diff)
downloadmorph-ce74ccdddae469cd6b9ebe88f35c402310cacce1.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()