Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 43bf286

Browse files
authored
Merge pull request #3762 from input-output-hk/devops-1100-hydra-eval-catch-errors
[DEVOPS-1100] Catch errors in check-hydra.sh and exit appropriately
2 parents 5938d2f + 2a7fa1c commit 43bf286

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

default.nix

+9-4
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ let
127127
# Backwards compat for iohk-ops.
128128
makeFaucetFrontend = self.cardano-sl-faucet-frontend;
129129

130+
####################################################################
131+
# Report Server
132+
133+
cardano-report-server-static = self.justStaticExecutablesGitRev self.cardano-report-server;
134+
130135

131136
####################################################################
132137
# Daedalus wallet
@@ -265,7 +270,6 @@ let
265270
cardano-sl-crypto
266271
cardano-sl-db
267272
cardano-sl-explorer
268-
cardano-sl-explorer-frontend
269273
cardano-sl-explorer-static
270274
cardano-sl-generator
271275
cardano-sl-infra
@@ -276,9 +280,10 @@ let
276280
cardano-sl-util
277281
cardano-sl-wallet
278282
cardano-sl-wallet-new
279-
cardano-sl-x509
280-
cardano-report-server
281-
cardano-report-server-static; }
283+
cardano-sl-x509;
284+
inherit (self.haskellPackages)
285+
cardano-report-server; }
286+
282287
);
283288

284289
in

scripts/ci/check-hydra.sh

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1-
#!/bin/sh
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -p jq -i bash
23

34
nix-build https://github.com/nixos/nixpkgs/archive/4fb198892d298452023ab176e7067da58d30772e.tar.gz -A hydra
45
echo '~~~ Evaluating release.nix'
5-
./result/bin/hydra-eval-jobs -I . release.nix
6+
command 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 eval-time.txt
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

0 commit comments

Comments
 (0)