Skip to content

Commit

Permalink
fix: fix deploy folder artifacts with checksum enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
anancarv authored Sep 5, 2024
2 parents ec0c66a + 28dd984 commit fdc6be6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,14 @@ artifact = art.artifacts.deploy("<LOCAL_FILE_LOCATION>", "<ARTIFACT_PATH_IN_ARTI
artifact = art.artifacts.deploy("<LOCAL_FILE_LOCATION>", "<ARTIFACT_PATH_IN_ARTIFACTORY>", checksum_enabled=True)
# artifact = art.artifacts.deploy("Desktop/myNewFile.txt", "my-repository/my/new/artifact/directory/file.txt", checksums=True)
```
Note: the performance might suffer when deploying artifacts with checksums enabled.
Deploy an artifact to the specified destination by checking if the artifact content already exists in Artifactory.

If Artifactory already contains a user-readable artifact with the same checksum the artifact content is copied over
to the new location and returns a response without requiring content transfer.

Otherwise, a 404 error is returned to indicate that content upload is expected in order to deploy the artifact.

**Note**: The performance might suffer when deploying artifacts with checksums enabled.

#### Download an artifact
```python
Expand Down
2 changes: 1 addition & 1 deletion pyartifactory/objects/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def deploy(
for root, _, files in os.walk(local_file.as_posix()):
new_root = f"{artifact_folder}/{root[len(local_file.as_posix()):]}"
for file in files:
self.deploy(Path(f"{root}/{file}"), Path(f"{new_root}/{file}"))
self.deploy(Path(f"{root}/{file}"), Path(f"{new_root}/{file}"), checksum_enabled)
else:
if checksum_enabled:
artifact_check_sums = Checksums.generate(local_file)
Expand Down

0 comments on commit fdc6be6

Please sign in to comment.