refactor(ops/tvl-buildkite): remove hardcoded whitby references
Change-Id: I3b2df9d3926f4698cbc0b557ad5b522e1921ca13 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12988 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: aaqaishtyaq <aaqaishtyaq@gmail.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
83b22e177b
commit
4210e2c480
1 changed files with 6 additions and 3 deletions
|
|
@ -5,8 +5,9 @@ let
|
||||||
cfg = config.services.depot.buildkite;
|
cfg = config.services.depot.buildkite;
|
||||||
agents = lib.range 1 cfg.agentCount;
|
agents = lib.range 1 cfg.agentCount;
|
||||||
description = "Buildkite agents for TVL";
|
description = "Buildkite agents for TVL";
|
||||||
|
hostname = config.networking.hostName;
|
||||||
|
|
||||||
besadiiWithConfig = name: pkgs.writeShellScript "besadii-whitby" ''
|
besadiiWithConfig = name: pkgs.writeShellScript "besadii-${hostname}" ''
|
||||||
export BESADII_CONFIG=/run/agenix/buildkite-besadii-config
|
export BESADII_CONFIG=/run/agenix/buildkite-besadii-config
|
||||||
exec -a ${name} ${depot.ops.besadii}/bin/besadii "$@"
|
exec -a ${name} ${depot.ops.besadii}/bin/besadii "$@"
|
||||||
'';
|
'';
|
||||||
|
|
@ -36,7 +37,7 @@ in
|
||||||
# Run the Buildkite agents using the default upstream module.
|
# Run the Buildkite agents using the default upstream module.
|
||||||
services.buildkite-agents = builtins.listToAttrs (map
|
services.buildkite-agents = builtins.listToAttrs (map
|
||||||
(n: rec {
|
(n: rec {
|
||||||
name = "whitby-${toString n}";
|
name = "${hostname}-${toString n}";
|
||||||
value = {
|
value = {
|
||||||
inherit name;
|
inherit name;
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -47,6 +48,8 @@ in
|
||||||
export PATH=$PATH:/run/wrappers/bin
|
export PATH=$PATH:/run/wrappers/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
tags.hostname = hostname;
|
||||||
|
|
||||||
runtimePackages = with pkgs; [
|
runtimePackages = with pkgs; [
|
||||||
bash
|
bash
|
||||||
coreutils
|
coreutils
|
||||||
|
|
@ -67,7 +70,7 @@ in
|
||||||
groups.buildkite-agents = { };
|
groups.buildkite-agents = { };
|
||||||
users = builtins.listToAttrs (map
|
users = builtins.listToAttrs (map
|
||||||
(n: rec {
|
(n: rec {
|
||||||
name = "buildkite-agent-whitby-${toString n}";
|
name = "buildkite-agent-${hostname}-${toString n}";
|
||||||
value = {
|
value = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = lib.mkForce "buildkite-agents";
|
group = lib.mkForce "buildkite-agents";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue