about summary refs log tree commit diff
path: root/ops/buildkite
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-06-06T21·24+0000
committertazjin <tazjin@tvl.su>2022-06-07T09·32+0000
commit72f91f032bbda43e2151196ea70bee84a435d4b8 (patch)
treefe558c9b9e0fc40a243768fd1e3ddbb9a59e267e /ops/buildkite
parente0c6198d582970fa7b03fd885ca151ec4964f670 (diff)
refactor(ops/buildkite): Use tools.checks.validateTerraform r/4225
Remove some code duplication.

Change-Id: I7ff49e728e1bd584bca3b84cdc033d93e60aefc2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5851
Tested-by: BuildkiteCI
Reviewed-by: asmundo <asmundo@gmail.com>
Diffstat (limited to 'ops/buildkite')
-rw-r--r--ops/buildkite/default.nix14
1 files changed, 6 insertions, 8 deletions
diff --git a/ops/buildkite/default.nix b/ops/buildkite/default.nix
index 46c20e4a5f93..0d39bc06010d 100644
--- a/ops/buildkite/default.nix
+++ b/ops/buildkite/default.nix
@@ -5,12 +5,10 @@ depot.nix.readTree.drvTargets rec {
     p.buildkite
   ]);
 
-  validate = pkgs.runCommand "tf-validate-buildkite"
-    {
-      BUILDKITE_API_TOKEN = "ci-dummy";
-    } ''
-    cp -r ${lib.cleanSource ./.}/* . && chmod -R u+w .
-    ${terraform}/bin/terraform init -upgrade -backend=false -input=false
-    ${terraform}/bin/terraform validate | tee $out
-  '';
+  validate = depot.tools.checks.validateTerraform {
+    inherit terraform;
+    name = "buildkite";
+    src = lib.cleanSource ./.;
+    env.BUILDKITE_API_TOKEN = "ci-dummy";
+  };
 }