add branches to hydra
This commit is contained in:
parent
4f3641a98e
commit
51c3878ca5
@ -1,4 +1,4 @@
|
|||||||
{ pulls, ... }:
|
{ pulls, branches, ... }:
|
||||||
let
|
let
|
||||||
# create the json spec for the jobset
|
# create the json spec for the jobset
|
||||||
makeSpec =
|
makeSpec =
|
||||||
@ -18,7 +18,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
prs = readJSONFile pulls;
|
prs = readJSONFile pulls;
|
||||||
# refs = readJSONFile branches;
|
refs = readJSONFile branches;
|
||||||
|
|
||||||
# template for creating a job
|
# template for creating a job
|
||||||
makeJob =
|
makeJob =
|
||||||
@ -44,20 +44,22 @@ let
|
|||||||
emailoverride = "";
|
emailoverride = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
giteaHost = "ssh://nayeonie.com:2222";
|
||||||
|
repo = "ahuston-0/nix-dotfiles";
|
||||||
# # Create a hydra job for a branch
|
# # Create a hydra job for a branch
|
||||||
# jobOfRef =
|
jobOfRef =
|
||||||
# name:
|
name:
|
||||||
# { ref, ... }:
|
{ ref, ... }:
|
||||||
# if ((builtins.match "^refs/heads/(.*)$" ref) == null) then
|
if ((builtins.match "^refs/heads/(.*)$" ref) == null) then
|
||||||
# null
|
null
|
||||||
# else
|
else
|
||||||
# {
|
{
|
||||||
# name = builtins.replaceStrings [ "/" ] [ "-" ] "branch-${name}";
|
name = builtins.replaceStrings [ "/" ] [ "-" ] "branch-${name}";
|
||||||
# value = makeJob {
|
value = makeJob {
|
||||||
# description = "Branch ${name}";
|
description = "Branch ${name}";
|
||||||
# flake = "git+ssh://git@github.com/${repo}?ref=${ref}";
|
flake = "git+${giteaHost}/${repo}?ref=${ref}";
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
|
|
||||||
# Create a hydra job for a PR
|
# Create a hydra job for a PR
|
||||||
jobOfPR = id: info: {
|
jobOfPR = id: info: {
|
||||||
@ -75,12 +77,12 @@ let
|
|||||||
# wrapper function for reading json from file
|
# wrapper function for reading json from file
|
||||||
readJSONFile = f: builtins.fromJSON (builtins.readFile f);
|
readJSONFile = f: builtins.fromJSON (builtins.readFile f);
|
||||||
# remove null values from a set, in-case of branches that don't exist
|
# remove null values from a set, in-case of branches that don't exist
|
||||||
# mapFilter = f: l: builtins.filter (x: (x != null)) (map f l);
|
mapFilter = f: l: builtins.filter (x: (x != null)) (map f l);
|
||||||
|
|
||||||
# Create job set from PRs and branches
|
# Create job set from PRs and branches
|
||||||
jobs = makeSpec (
|
jobs = makeSpec (
|
||||||
builtins.listToAttrs (map ({ name, value }: jobOfPR name value) (attrsToList prs))
|
builtins.listToAttrs (map ({ name, value }: jobOfPR name value) (attrsToList prs))
|
||||||
# // builtins.listToAttrs (mapFilter ({ name, value }: jobOfRef name value) (attrsToList refs))
|
// builtins.listToAttrs (mapFilter ({ name, value }: jobOfRef name value) (attrsToList refs))
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,11 @@
|
|||||||
"type": "giteapulls",
|
"type": "giteapulls",
|
||||||
"value": "nayeonie.com ahuston-0 nix-dotfiles https",
|
"value": "nayeonie.com ahuston-0 nix-dotfiles https",
|
||||||
"emailresponsible": false
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"branches": {
|
||||||
|
"type": "gitea_refs",
|
||||||
|
"value": "nayeonie.com ahuston-0 nix-dotfiles heads https -",
|
||||||
|
"emailresponsible": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user