Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding download_item to file_container_client to download individual … - #384

Closed
Max Velitchko (maximvelichko) wants to merge 0 commit into
microsoft:devfrom
maximvelichko:dev
Closed

Adding download_item to file_container_client to download individual …#384
Max Velitchko (maximvelichko) wants to merge 0 commit into
microsoft:devfrom
maximvelichko:dev

Conversation

@maximvelichko

Copy link
Copy Markdown
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