This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree 1 file changed +25
-2
lines changed
1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/bin/env nix-shell
2
+ #! nix-shell -p jq -i bash
2
3
3
4
nix-build https://github.com/nixos/nixpkgs/archive/4fb198892d298452023ab176e7067da58d30772e.tar.gz -A hydra
4
5
echo ' ~~~ Evaluating release.nix'
5
- ./result/bin/hydra-eval-jobs -I . release.nix
6
+ env time --format ' %e' -o eval-time.txt ./result/bin/hydra-eval-jobs -I . release.nix > eval.json
7
+ EVAL_EXIT_CODE=" $? "
8
+ if [ " $EVAL_EXIT_CODE " != 0 ]
9
+ then
10
+ rm eval.json
11
+ echo -e " \e[31;1mERROR: Failed to evaluate release.nix\e[0m"
12
+ exit 1
13
+ fi
14
+ EVAL_TIME=$( cat eval-time.txt)
15
+ jq . < eval.json
16
+ ERRORS=$( jq -r ' map_values(.error)|to_entries[]|select(.value)|@text "\(.key): \(.value)"' < eval.json)
17
+ NUM_ERRORS=$( jq -r ' [ map_values(.error)|to_entries[]|select(.value) ] |length' < eval.json)
18
+ rm eval.json eval-time.txt
19
+
20
+ if [ " $NUM_ERRORS " != 0 ]
21
+ then
22
+ echo -e " \e[31;1mERROR: evaluation completed in $EVAL_TIME seconds with $NUM_ERRORS errors\e[0m"
23
+ echo $ERRORS
24
+ exit 1
25
+ else
26
+ echo -e " \e[32;1mOK: evaluation completed in $EVAL_TIME seconds with no errors\e[0m"
27
+ exit 0
28
+ fi
You can’t perform that action at this time.
0 commit comments