buildkite: allow configuration and actual use of agent-specific hooks
(cherry picked from commit 775e49439fe25a4cdc2a93e31dfb3968b9b02311) Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
parent
1dc391d92b
commit
bbb6072f10
@ -48,6 +48,14 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hooks-path = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.buildkite-agent}/share/hooks";
|
||||||
|
description = ''
|
||||||
|
Path to the directory storing the hooks.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta-data = mkOption {
|
meta-data = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
@ -114,10 +122,12 @@ in
|
|||||||
token="$(cat ${toString cfg.tokenPath})"
|
token="$(cat ${toString cfg.tokenPath})"
|
||||||
name="${cfg.name}"
|
name="${cfg.name}"
|
||||||
meta-data="${cfg.meta-data}"
|
meta-data="${cfg.meta-data}"
|
||||||
hooks-path="${pkgs.buildkite-agent}/share/hooks"
|
|
||||||
build-path="${cfg.dataDir}/builds"
|
build-path="${cfg.dataDir}/builds"
|
||||||
|
hooks-path="${cfg.hooks-path}"
|
||||||
bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh"
|
bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
|
Loading…
Reference in New Issue
Block a user