summaryrefslogtreecommitdiff
path: root/gear/worker.py
diff options
context:
space:
mode:
Diffstat (limited to 'gear/worker.py')
-rw-r--r--gear/worker.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/gear/worker.py b/gear/worker.py
index b11f78bf..d1e961aa 100644
--- a/gear/worker.py
+++ b/gear/worker.py
@@ -38,4 +38,23 @@ while True:
elif job.name == "build-artifact":
artifact = distbuild.decode_artifact_reference(job.arguments)
print "building %s" % artifact.name
+ cmd = ['morph', 'worker-build', '--build-log-on-stdout', artifact.name]
+ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
+ output = p.communicate(input=job.arguments)[0]
+ job.sendWorkData(output)
+
+ kind = artifact.kind
+
+ if kind == 'chunk':
+ artifact_names = artifact.source_artifact_names
+
+ suffixes = ['%s.%s' % (kind, name) for name in artifact_names]
+ suffixes.append('build-log')
+ else:
+ filename = '%s.%s' % (kind, job.artifact.name)
+ suffixes = [filename]
+
+ if kind == 'stratum':
+ suffixes.append(filename + '.meta')
+
job.sendWorkComplete(artifact.cache_key)