kazerm
kazerm

Reputation: 529

Retrieving the build number from artifactory file

I'm using the jenkins generic plugin to upload to artifactory. I'm uploading each file to two places:

  1. /build_number
  2. /latest - this file is being overwritten on each build

Now, the user, who is using Rest API to download the file from the latest directory (this way he always get the latest file), need to know to which build number it belongs to.

How do I know, using Rest API, to which build, this file belongs to?

Upvotes: 2

Views: 2226

Answers (1)

kazerm
kazerm

Reputation: 529

I actually found the solution. by running this api:

http://artifactory.yourorg.com/artifactory/api/storage/Development/myrepo/latest/myfile.zip?properties=build.number

It will return: "properties": { "build.number": [ "12000067" ] },

Upvotes: 3

Related Questions