forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
81 lines (79 loc) · 2.75 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
let
fixedNixpkgs = (import ./lib.nix).fetchNixPkgs;
in
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, scrubJobs ? true
, cardano ? { outPath = ./.; rev = "abcdef"; }
, nixpkgsArgs ? {
config = { allowUnfree = false; inHydra = true; };
gitrev = cardano.rev;
}
}:
with (import (fixedNixpkgs + "/pkgs/top-level/release-lib.nix") {
inherit supportedSystems scrubJobs nixpkgsArgs;
packageSet = import ./.;
});
let
iohkPkgs = import ./. { gitrev = cardano.rev; };
pkgs = import fixedNixpkgs { config = {}; };
wrapDockerImage = cluster: let
images = {
mainnet = iohkPkgs.dockerImages.mainnet.wallet;
staging = iohkPkgs.dockerImages.staging.wallet;
};
image = images."${cluster}";
in pkgs.runCommand "${image.name}-hydra" {} ''
mkdir -pv $out/nix-support/
cat <<EOF > $out/nix-support/hydra-build-products
file dockerimage ${image}
EOF
'';
platforms = {
cardano-sl = supportedSystems;
cardano-sl-auxx = supportedSystems;
cardano-sl-node-static = supportedSystems;
cardano-sl-tools = supportedSystems;
cardano-sl-wallet = supportedSystems;
cardano-sl-wallet-new = supportedSystems;
all-cardano-sl = supportedSystems;
cardano-sl-explorer-static = [ "x86_64-linux" ];
cardano-sl-explorer = [ "x86_64-linux" ];
cardano-sl-explorer-frontend = [ "x86_64-linux" ];
cardano-report-server-static = [ "x86_64-linux" ];
cardano-report-server = [ "x86_64-linux" ];
stack2nix = supportedSystems;
purescript = supportedSystems;
daedalus-bridge = supportedSystems;
};
platforms' = {
connectScripts.mainnet.wallet = [ "x86_64-linux" "x86_64-darwin" ];
connectScripts.mainnet.explorer = [ "x86_64-linux" "x86_64-darwin" ];
connectScripts.staging.wallet = [ "x86_64-linux" "x86_64-darwin" ];
connectScripts.staging.explorer = [ "x86_64-linux" "x86_64-darwin" ];
connectScripts.testnet.wallet = [ "x86_64-linux" "x86_64-darwin" ];
connectScripts.testnet.explorer = [ "x86_64-linux" "x86_64-darwin" ];
};
mapped = mapTestOn platforms;
mapped' = mapTestOn platforms';
makeConnectScripts = cluster: let
in {
inherit (mapped'.connectScripts."${cluster}") wallet explorer;
};
nixosTests = import ./nixos-tests;
tests = iohkPkgs.tests;
makeRelease = cluster: {
name = cluster;
value = {
dockerImage = wrapDockerImage cluster;
connectScripts = makeConnectScripts cluster;
};
};
in mapped // {
inherit tests;
inherit (pkgs) cabal2nix;
nixpkgs = let
wrapped = pkgs.runCommand "nixpkgs" {} ''
ln -sv ${fixedNixpkgs} $out
'';
in if 0 <= builtins.compareVersions builtins.nixVersion "1.12" then wrapped else fixedNixpkgs;
} // (builtins.listToAttrs (map makeRelease [ "mainnet" "staging" ]))