0

I would like to download an artifact from a Jenkins job. While this is straight-forward, I also, in advance, need a sha256 of the artifact but could not find a way yet, to retrieve it.

So question is - is there any way to get the hash or at least a way to upload the sha256, so it directly gets exposed by the REST API?


Caveat - I have artifacts above 1GB, as such I do not want to manually generate the sha256 in the Job, but have it processed "offline" somewhere not impacting Job time.

abergmeier
  • 13,224
  • 13
  • 64
  • 120
  • 1
    What is the direct purpose? Because jenkins can fingerprint files: https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint. And what do you mean by 'offline' ? After you downloaded it, or async on the server? – Rik May 17 '17 at 05:49
  • Because as far as I know, to compute the sha, the file neads to be read – Rik May 17 '17 at 05:50
  • I clarified in the question. Optimally when uploaded, Jenkins would start generating the sha in a parallel background thread and provide that sha in the REST API, with the REST request blocking as long as the sha has not been processed. – abergmeier May 17 '17 at 08:14
  • I doubt if you can inject in the json in the best case you can update a (env)variable. Also blocking json requests sounds like very bad practice if it would even be possible. It can be confusing, you wont know if it is unavailable or computing. You would rather have the value be `generating`, `failed` or ``, so you can poll. But like i said I doubt you can inject. But I don't know much about that, unfortunately. – Rik May 17 '17 at 10:24

0 Answers0