Created
June 11, 2020 19:44
-
-
Save LnL7/a2d7d2e155a2bf3a71c28b27b21f4e1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hydra-job-revision() { | |
local jobseteval job=$1 | |
shift 1 | |
case "$job" in | |
*'/'*) ;; | |
*) job="nixpkgs/trunk/$job" ;; | |
esac | |
case "$job" in | |
'http://'*|'https://'*) ;; | |
*) job="https://hydra.nixos.org/job/$job" ;; | |
esac | |
jobseteval=$(curl -fsSL -H 'Content-Type: application/json' "$job/latest" | jq '.jobsetevals[0]') | |
curl -fsSL -H 'Accept: application/json' "''${job%/job*}/eval/$jobseteval" | jq -r '.jobsetevalinputs.nixpkgs.revision' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment