I'm using jfrog-cli in an automation which updates a database on every successful artifact download. The automation is written in Perl and it is simply using the system exit code jfrog process. Problem is, that jfrog-cli exits with exit code 0 each time it skips or successfully downloads any artifact.
Here is a pseudo code for what I'm doing-
system("jfrog rt dl --url https://$artifactory_server/artifactory --user $artifactory_username --password $artifactory_password $source $destination");
if ($? == -1) {
print "failed to execute: $!\n";
# notify the failure
}
elsif ($? & 127) {
printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without';
# notify the failure
}
else {
printf "child exited with value %d\n", $? >> 8;
# update the database
}