mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
CI rewrite for only enabled target hosts
This commit is contained in:
parent
0bd5d2b237
commit
15c6902491
2 changed files with 13 additions and 4 deletions
|
|
@ -46,8 +46,13 @@ with lib; {
|
|||
};
|
||||
displayName = "niv update build";
|
||||
environment = [ "OPENSSH_PRIVATE_KEY" "CACHIX_SIGNING_KEY" "GITHUB_REF" ];
|
||||
command = let hostnames = remove "dummy" (lib.attrNames (import ../.).hosts);
|
||||
hostBuildString = concatMapStrings (host: "nix build -Lf . network.nodes.${host}.deploy.system && nix-collect-garbage -d && " ) hostnames; in ''
|
||||
command = let main = (import ../.);
|
||||
hosts = main.network.nodes;
|
||||
targets = main.deploy.targets;
|
||||
enabledTargets = filterAttrs (_: v: v.enable) main.deploy.targets;
|
||||
enabledHosts = concatLists (mapAttrsToList (targetName: target: target.nodeNames) enabledTargets);
|
||||
hostBuildString = concatMapStrings (host: "nix build -Lf . network.nodes.${host}.deploy.system && nix-collect-garbage -d && " ) enabledHosts;
|
||||
in ''
|
||||
# ${toString builtins.currentTime}
|
||||
if [[ -n $OPENSSH_PRIVATE_KEY ]]; then
|
||||
mkdir ~/.ssh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue