Updated builbot config

This commit is contained in:
Julien Malka 2023-05-07 13:51:12 +02:00
parent 35a1ae8b32
commit db9c2e07c5
Signed by: Luj
GPG key ID: 6FC74C847011FD83
2 changed files with 51 additions and 7 deletions

View file

@ -20,7 +20,7 @@ from buildbot.process.results import FAILURE
from buildbot.steps.master import SetProperty
def failure(step):
return step.getProperty("GitFailed")
return (step.getProperty("GitFailed")=="failed")
class BuildTrigger(Trigger):
"""
@ -236,12 +236,11 @@ def nix_update_flake_config(
submodules=True,
branch="update_flake_lock",
haltOnFailure=False,
warnOnFailure=True,
flunkOnFailure=False,
#flunkOnFailure=False,
)
)
factory.addStep(SetProperty(property="GitFailed", value="failed", hideStepIf=True, doStepIf=(lambda step: step.build.results == FAILURE)))
factory.addStep(SetProperty(property="GitFailed", value="failed", doStepIf=(lambda step: step.build.results == FAILURE)))
factory.addStep(
steps.Git(
@ -253,7 +252,6 @@ def nix_update_flake_config(
mode="full",
branch="main",
doStepIf=failure,
hideStepIf=lambda _, x: not(failure(x))
)
)
factory.addStep(steps.ShellCommand(
@ -266,7 +264,6 @@ def nix_update_flake_config(
],
haltOnFailure=True,
doStepIf=failure,
hideStepIf=lambda _, x: not(failure(x))
)
)

View file

@ -64,6 +64,17 @@ def build_config() -> dict[str, Any]:
builderNames=["nix-eval-linkal"],
),
schedulers.SingleBranchScheduler(
name="main-nixos-proxmox",
change_filter=util.ChangeFilter(
repository=f"https://github.com/JulienMalka/nixos-proxmox",
filter_fn=lambda c: c.branch
== c.properties.getProperty("github.repository.default_branch"),
),
builderNames=["nix-eval-nixos-proxmox"],
),
# build all pull requests
schedulers.SingleBranchScheduler(
name="prs-nix-config",
@ -80,7 +91,15 @@ def build_config() -> dict[str, Any]:
),
builderNames=["nix-eval-linkal"],
),
schedulers.SingleBranchScheduler(
name="prs-nixos-proxmox",
change_filter=util.ChangeFilter(
repository=f"https://github.com/JulienMalka/nixos-proxmox", category="pull"
),
builderNames=["nix-eval-nixos-proxmox"],
),
# this is triggered from `nix-eval`
schedulers.Triggerable(
name="nix-build",
@ -99,6 +118,12 @@ def build_config() -> dict[str, Any]:
builderNames=["nix-update-flake-nix-config"],
buttonName="Update flakes",
),
schedulers.ForceScheduler(
name="update-flake-nixos-proxmox",
builderNames=["nix-update-flake-nixos-proxmox"],
buttonName="Update flakes",
),
# updates flakes once a weeek
schedulers.Nightly(
@ -114,6 +139,14 @@ def build_config() -> dict[str, Any]:
hour=1,
minute=0,
),
schedulers.Nightly(
name="update-flake-daily-nixos-proxmox",
builderNames=["nix-update-flake-nixos-proxmox"],
dayOfWeek=5,
hour=1,
minute=0,
),
]
@ -155,6 +188,12 @@ def build_config() -> dict[str, Any]:
"linkal",
github_token_secret="github-token",
),
nix_eval_config(
[worker_names[0]],
"nixos-proxmox",
github_token_secret="github-token",
),
nix_build_config(worker_names),
nix_update_flake_config(
@ -171,6 +210,14 @@ def build_config() -> dict[str, Any]:
github_token_secret="github-token",
github_bot_user=BUILDBOT_GITHUB_USER,
),
nix_update_flake_config(
worker_names,
"nixos-proxmox",
f"JulienMalka/nixos-proxmox",
github_token_secret="github-token",
github_bot_user=BUILDBOT_GITHUB_USER,
),
]