We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ca3080 commit cd3c70fCopy full SHA for cd3c70f
docs/gl_objects/builds.py
@@ -73,16 +73,11 @@
73
# end artifacts
74
75
# stream artifacts
76
-class Foo(object):
77
- def __init__(self):
78
- self._fd = open('artifacts.zip', 'wb')
79
-
80
- def __call__(self, chunk):
81
- self._fd.write(chunk)
82
83
-target = Foo()
84
-build_or_job.artifacts(streamed=True, action=target)
85
-del(target) # flushes data on disk
+zipfn = "___artifacts.zip"
+with open(zipfn, "wb") as f:
+ build_or_job.artifacts(streamed=True, action=f.write)
+subprocess.run(["unzip", "-bo", zipfn])
+os.unlink(zipfn)
86
# end stream artifacts
87
88
# keep artifacts
0 commit comments