Skip to content

Commit 0fb89cc

Browse files
committed
enable post-build-hook that uploads to spongix in cicero job
this is useful for cicero's evaluator
1 parent 599b98a commit 0fb89cc

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

nix/cloud/nomadEnvs/cicero/default.nix

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@
1111
inherit (inputs.data-merge) merge;
1212
inherit (inputs.nixpkgs) writeText lib;
1313

14+
nixConfig = ''
15+
extra-substituters = http://spongix.service.consul:7745?compression=none
16+
extra-trusted-public-keys = ci-world-0:fdT/Z5YK5dxaV/kROE4EqaxwTcQSpVpVCSTKuTyIXFY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
17+
post-build-hook = /local/post-build-hook
18+
'';
19+
20+
postBuildHook = ''
21+
#! /bin/bash
22+
set -euf
23+
export IFS=" "
24+
if [[ -n "$OUT_PATHS" ]]; then
25+
echo "Uploading to cache: $OUT_PATHS"
26+
exec nix copy --to "http://spongix.service.consul:7745?compression=none" $OUT_PATHS
27+
fi
28+
'';
29+
1430
transformers = [
1531
{
1632
destination = "/local/transformer-prod.sh";
@@ -21,20 +37,7 @@
2137
nixpkgsRev = "19574af0af3ffaf7c9e359744ed32556f34536bd";
2238
datacenters = ["eu-central-1"];
2339
ciceroWebUrl = "https://cicero.ci.iog.io";
24-
nixConfig = ''
25-
extra-substituters = http://spongix.service.consul:7745?compression=none
26-
extra-trusted-public-keys = ci-world-0:fdT/Z5YK5dxaV/kROE4EqaxwTcQSpVpVCSTKuTyIXFY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
27-
post-build-hook = /local/post-build-hook
28-
'';
29-
postBuildHook = ''
30-
#! /bin/bash
31-
set -euf
32-
export IFS=" "
33-
if [[ -n "$OUT_PATHS" ]]; then
34-
echo "Uploading to cache: $OUT_PATHS"
35-
exec nix copy --to "http://spongix.service.consul:7745?compression=none" $OUT_PATHS
36-
fi
37-
'';
40+
inherit nixConfig postBuildHook;
3841
};
3942
in ''
4043
#! /bin/bash
@@ -112,7 +115,10 @@
112115
NOMAD_ADDR = "https://nomad.${domain}";
113116
VAULT_ADDR = "https://vault.${domain}";
114117

115-
NIX_CONFIG = "netrc-file = /secrets/netrc";
118+
NIX_CONFIG = ''
119+
netrc-file = /secrets/netrc
120+
${nixConfig}
121+
'';
116122

117123
# go-getter reads from the NETRC env var or $HOME/.netrc
118124
# https://github.com/hashicorp/go-getter/blob/4553965d9c4a8d99bd0d381c1180c08e07eff5fd/netrc.go#L24
@@ -166,6 +172,12 @@
166172
}
167173
}'';
168174
}
175+
176+
{
177+
destination = "/local/post-build-hook";
178+
perms = "544";
179+
data = postBuildHook;
180+
}
169181
];
170182
};
171183
};

0 commit comments

Comments
 (0)