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.
2 parents 424a8cb + 9a068e0 commit 12a40ccCopy full SHA for 12a40cc
docs/gl_objects/pipelines_and_jobs.rst
@@ -301,16 +301,8 @@ Get the artifacts of a job::
301
You can download artifacts as a stream. Provide a callable to handle the
302
stream::
303
304
- class Foo(object):
305
- def __init__(self):
306
- self._fd = open('artifacts.zip', 'wb')
307
-
308
- def __call__(self, chunk):
309
- self._fd.write(chunk)
310
311
- target = Foo()
312
- build_or_job.artifacts(streamed=True, action=target)
313
- del(target) # flushes data on disk
+ with open("archive.zip", "wb") as f:
+ build_or_job.artifacts(streamed=True, action=f.write)
314
315
You can also directly stream the output into a file, and unzip it afterwards::
316
0 commit comments