Martin Ba
Martin Ba

Reputation: 38785

Overwriting Artifactory artifacts (and history)?

I'm currently trying to get a feel for Artifactory and playing around with deploying "generic" artifacts into a simple repo. (I'm using the web interface as well as a minimal Jenkins upload by Upload File Spec.)

What I see is that I can deploy an artifact under the same name/path more than once, e.g. I have the artifact http://localhost:8081/artifactory/martin-repo/martin/bla/foo.zip in my martin-repo and I can deploy this as often as I want and it will just overwrite it.

It will just list a

  • Created: 25-01-17 23:20:09 +01:00
  • Last Modified: 25-01-17 23:32:33 +01:00

for the artifact under http://localhost:8081/artifactory/webapp/#/artifacts/browse/tree/General/martin-repo/.../...

Questions --


Disclaimer: I'm a total Noob here, so if I miss something, feel free to point out any RTFM.

From the examples I see, it seems normally one would include a version number in the path to be deployed, but as far as I can tell, the path would be "client"-generated, so the server has to have some handle on this also?

Upvotes: 1

Views: 14250

Answers (1)

Ariel
Ariel

Reputation: 3506

Is there some kind of history of different "versions" of an artifact in Artifactory?

If I understand you correctly you mean something like in version control, to roll back to older files. If this is the case then the answer that this is not something that is available in Artifactory


Or is the old version just lost as soon as a new version under the same path is deployed?

Once a file is overridden, the old one is lost. Please note that overriding files, especially releases, considered bad practice.


Is there any write-once option for a repository, so that each artifact path can by default only be uploaded once?

The only option that you have will be to remove "Delete/Overwrite" permission to the users. Then, once they will try to write a file that already exist they will get the following error:

{
    "errors" : [ {
        "status" : 403,
        "message" : "Not enough permissions to overwrite artifact 'XXX' (user 'YYY' needs DELETE permission)."
    } ]
}

Upvotes: 3

Related Questions