Last active
September 20, 2018 23:13
-
-
Save LnL7/81553319258460b4e04f0251133da1cc 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
#!/usr/bin/env bash | |
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' | |
} | |
hydra-job-revision "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment