Skip to content

Commit 9357f51

Browse files
authored
Merge pull request #431 from nix-community/dev-workflow
dev-workflow: setup url correctly
2 parents cbc79e1 + 689fc9f commit 9357f51

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

buildbot_nix/buildbot_nix/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ class BuildbotNixConfig(BaseModel):
263263
db_url: str
264264
build_systems: list[str]
265265
domain: str
266-
webhook_base_url: str
267266
url: str
268267

269268
use_https: bool = False

nixosModules/master.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ in
768768
eval_max_memory_size = cfg.evalMaxMemorySize;
769769
eval_worker_count = cfg.evalWorkerCount;
770770
domain = cfg.domain;
771-
webhook_base_url = cfg.webhookBaseUrl;
772771
use_https = cfg.useHTTPS;
773772
outputs_path = cfg.outputsPath;
774773
url = config.services.buildbot-nix.master.webhookBaseUrl;

packages/buildbot-dev.nix

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
{
2-
writeShellScriptBin,
3-
python,
2+
bash,
43
buildbot,
5-
buildbot-worker,
6-
buildbot-nix,
7-
buildbot-gitea,
84
buildbot-effects,
5+
buildbot-gitea,
6+
buildbot-nix,
97
buildbot-plugins,
8+
buildbot-worker,
9+
cachix,
10+
coreutils,
11+
git,
12+
lib,
13+
nix,
14+
nix-eval-jobs,
15+
openssh,
16+
python,
17+
writeShellScriptBin,
1018
}:
1119
let
1220
pythonEnv = python.withPackages (ps: [
@@ -22,6 +30,18 @@ in
2230
writeShellScriptBin "buildbot-dev" ''
2331
set -xeuo pipefail
2432
git_root=$(git rev-parse --show-toplevel)
33+
export PATH=${
34+
lib.makeBinPath [
35+
nix-eval-jobs
36+
cachix
37+
git
38+
openssh
39+
nix
40+
bash
41+
coreutils
42+
buildbot-effects
43+
]
44+
}
2545
mkdir -p "$git_root/.buildbot-dev"
2646
cd "$git_root/.buildbot-dev"
2747
"${pythonEnv}/bin/buildbot" create-master .

packages/master.cfg.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
NixConfigurator,
44
BuildbotNixConfig,
55
)
6+
from buildbot.plugins import util
67
from buildbot.process.factory import BuildFactory
78

89
factory = BuildFactory()
910

1011
STATE_DIR = Path(".")
1112
PORT = 8012
13+
url = f"http://localhost:{PORT}"
1214

1315
buildbot_nix_config = BuildbotNixConfig(
1416
db_url="sqlite:///state.sqlite",
@@ -27,16 +29,18 @@
2729
eval_worker_count=4,
2830
local_workers=4,
2931
domain="localhost",
30-
webhook_base_url=f"http://localhost:{PORT}",
31-
url=f"http://localhost:{PORT}",
32+
webhook_base_url=url,
33+
url=url,
34+
admins=["admin"],
3235
)
3336

3437
c = BuildmasterConfig = dict(
3538
title="Hello World CI",
3639
titleURL="https://buildbot.github.io/hello-world/",
40+
buildbotURL=url,
3741
configurators=[
3842
NixConfigurator(buildbot_nix_config),
3943
],
4044
protocols={"pb": {"port": "tcp:9989:interface=\\:\\:1"}},
41-
www=dict(port=PORT, plugins=dict()),
45+
www=dict(port=PORT, plugins=dict(), auth=util.UserPasswordAuth({"admin": "admin"})),
4246
)

0 commit comments

Comments
 (0)