Get valid checksum from file in Artifactory

86 Views Asked by At

The Artifactory automatically calculates the checksum of any file I store, but when downloading it, it just returns the hash, not a valid checksum file.

When executing curl https://<artifactory_url>/<repository>/<file>.sha256 | sha256sum --check it fails complaining about the format sha256sum: 'standard input': no properly formatted SHA256 checksum lines found.

Is there any way of downloading a valid checksum file, containing the hash and the file name?

Thanks!

1

There are 1 best solutions below

1
Elvin Jafarov On

Here is the bash script, if I understood your question correctly

curl -o <file> https://<artifactory_url>/<repository>/<file>

curl -o <file>.sha256 https://<artifactory_url>/<repository>/<file>.sha256

hash=$(cat <file>.sha256)

echo "$hash  <file>" > <file>.sha256

sha256sum --check <file>.sha256