git.iko.soy/typeable/nixpkgs
on master help sign in
buildkite: allow configuration and actual use of agent-specific hooks

(cherry picked from commit 775e49439fe25a4cdc2a93e31dfb3968b9b02311) Signed-off-by: Domen Kožar <domen@dev.si>

commitbbb6072f10ed115aadaa7d433e81b212203561b5 authorKosyrev Serge <serge.kosyrev@iohk.io> dateTue 5 Dec 2017, 19:59 (9 years ago) parent1dc391d
1 file changed+11−1
nixos/modules/services/continuous-integration/buildkite-agent.nix+11−1
nixos/modules/services/continuous-integration/buildkite-agent.nix+11−1
@@ -48,6 +48,14 @@ in
4848 '';
4949 };
5050
51+ hooks-path = mkOption {
52+ type = types.str;
53+ default = "${pkgs.buildkite-agent}/share/hooks";
54+ description = ''
55+ Path to the directory storing the hooks.
56+ '';
57+ };
58+
5159 meta-data = mkOption {
5260 type = types.str;
5361 default = "";
@@ -114,10 +122,12 @@ in
114122 token="$(cat ${toString cfg.tokenPath})"
115123 name="${cfg.name}"
116124 meta-data="${cfg.meta-data}"
117− hooks-path="${pkgs.buildkite-agent}/share/hooks"
118125 build-path="${cfg.dataDir}/builds"
126+ hooks-path="${cfg.hooks-path}"
119127 bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh"
120128 EOF
129+
130+ chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths.
121131 '';
122132
123133 serviceConfig =