summary refs log tree commit diff
path: root/nixos/modules/services/continuous-integration
diff options
context:
space:
mode:
authorKosyrev Serge <serge.kosyrev@iohk.io>2017-12-05 19:59:59 +0300
committerDomen Kožar <domen@enlambda.com>2017-12-28 12:16:05 +0000
commitbbb6072f10ed115aadaa7d433e81b212203561b5 (patch)
tree921c73408c1203abc0aabcb649a718e5fa035eb4 /nixos/modules/services/continuous-integration
parent1dc391d92b8f6da6451eeb1e26ff174f0395665b (diff)
downloadnixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.tar
nixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.tar.gz
nixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.tar.bz2
nixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.tar.lz
nixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.tar.xz
nixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.tar.zst
nixlib-bbb6072f10ed115aadaa7d433e81b212203561b5.zip
buildkite: allow configuration and actual use of agent-specific hooks
(cherry picked from commit 775e49439fe25a4cdc2a93e31dfb3968b9b02311)
Signed-off-by: Domen Kožar <domen@dev.si>
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-rw-r--r--nixos/modules/services/continuous-integration/buildkite-agent.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/continuous-integration/buildkite-agent.nix b/nixos/modules/services/continuous-integration/buildkite-agent.nix
index dcc5e7174601..41a1cc9d6420 100644
--- a/nixos/modules/services/continuous-integration/buildkite-agent.nix
+++ b/nixos/modules/services/continuous-integration/buildkite-agent.nix
@@ -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 {
         type = types.str;
         default = "";
@@ -114,10 +122,12 @@ in
             token="$(cat ${toString cfg.tokenPath})"
             name="${cfg.name}"
             meta-data="${cfg.meta-data}"
-            hooks-path="${pkgs.buildkite-agent}/share/hooks"
             build-path="${cfg.dataDir}/builds"
+            hooks-path="${cfg.hooks-path}"
             bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh"
             EOF
+
+            chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths.
           '';
 
         serviceConfig =