artifactorybamboojfrog-clibamboo-jfrog-plugin

How can I delete uploads to jfrog by bamboo-jfrog-plugin, in case the build fails?


Let's say I have a plan with 2 stages in Bamboo.
The 1'st stage builds and uploads an artifact to jfrog using the bamboo-jfrog-plugin.
The 2'nd stage do something that fails, meaning the whole build failed.
On that case I wish to revert changes and remove all build artifacts that were pushed to the jfrog artifactory server.
Is there a simple way to "revert" and delete all this plan artifacts?


Solution

  • If you are collecting and publishing build info using JFrog CLI, you can then delete all build artifacts.

    The build can be deleted using one of the following JFrog CLI commands:

    1. The build discard command - delete build with its artifacts, for example: jf rt build-discard "my-build" --max-builds=1 --delete-artifacts
    2. Delete artifacts command with --build - only delete the artifacts.
    3. The cURL command combined with the delete builds REST API.