Skip to content

Comments

Adding download_item to file_container_client to download individual …#384

Closed
maximvelichko wants to merge 0 commit intomicrosoft:devfrom
maximvelichko:dev
Closed

Adding download_item to file_container_client to download individual …#384
maximvelichko wants to merge 0 commit intomicrosoft:devfrom
maximvelichko:dev

Conversation

@maximvelichko
Copy link
Contributor

…file from an artifact

To download a single file from a build's artifact:

        artifact = self.build_client.get_artifact(project_name, build_id, 'artifact_name')

        with open('/tmp/out.zip', 'wb') as f:
            for x in self.file_container_client.download_item(artifact.resource.data.split('/')[1], item_path='artifact_name/path/to/out.zip'):
                f.write(x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant