diff options
author | Max Wittig <max.wittig@siemens.com> | 2020-06-30 10:56:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 10:56:04 +0200 |
commit | 12a40cc3bdae6111ed750edb3c3a4ec8dbdaa8ef (patch) | |
tree | 618a2789fc858784e020e716693d202ae928cf89 | |
parent | 424a8cb3f3e0baa7d45748986395a7a921ba28b8 (diff) | |
parent | 9a068e00eba364eb121a2d7d4c839e2f4c7371c8 (diff) | |
download | gitlab-12a40cc3bdae6111ed750edb3c3a4ec8dbdaa8ef.tar.gz |
Merge pull request #1092 from aparcar/aparcar-patch-1
Update pipelines_and_jobs.rst
-rw-r--r-- | docs/gl_objects/pipelines_and_jobs.rst | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/docs/gl_objects/pipelines_and_jobs.rst b/docs/gl_objects/pipelines_and_jobs.rst index c79d19f..7faf657 100644 --- a/docs/gl_objects/pipelines_and_jobs.rst +++ b/docs/gl_objects/pipelines_and_jobs.rst @@ -301,16 +301,8 @@ Get the artifacts of a job:: You can download artifacts as a stream. Provide a callable to handle the stream:: - class Foo(object): - def __init__(self): - self._fd = open('artifacts.zip', 'wb') - - def __call__(self, chunk): - self._fd.write(chunk) - - target = Foo() - build_or_job.artifacts(streamed=True, action=target) - del(target) # flushes data on disk + with open("archive.zip", "wb") as f: + build_or_job.artifacts(streamed=True, action=f.write) You can also directly stream the output into a file, and unzip it afterwards:: |