4 If a snapshot link is given, then push it onto the builder redis queue
7 https://git.purplebirdman.com/wolf-seeking-sheep.git/snapshot/127ef0ef17ec1067f77bb7097e84a537a4a01ec7.tar.gz
10 function lpush_onto_job_queue(s)
11 local cmd = ("redis-cli -h redis LPUSH snapshots %s"):format(s)
12 local handle = io.popen(cmd)
13 local output = handle:read('*a')
20 local handle = io.open(s)
21 local output = handle:read('*a')
28 r.content_type = "text/html"
30 local args = r:parseargs()
31 local snapshot_uri = args.snapshot_uri
34 -- filename might have spaces that apache replaces with '+'
35 snapshot_uri = string.gsub(snapshot_uri, '+', ' ')
36 snapshot_uri = string.gsub(snapshot_uri, '%%2F', '/')
38 local out = lpush_onto_job_queue(snapshot_uri)
42 r:puts( dump_file(r.document_root .. '/build-request.html') )