about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-06-06T21·28+0000
committertazjin <tazjin@tvl.su>2022-06-07T09·32+0000
commit92a6e2538028987d589a22d1242ae8a4e4cfafe9 (patch)
treed90d15733a615ff53f897e6cb832567dd02b2958
parent72f91f032bbda43e2151196ea70bee84a435d4b8 (diff)
refactor(ops/glesys): Use tools.checks.validateTerraform r/4226
Remove some code duplication.

Change-Id: Ia9e0b3b22926eb9e72f302e2c1ebcee68eaa1db9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5852
Tested-by: BuildkiteCI
Reviewed-by: asmundo <asmundo@gmail.com>
-rw-r--r--ops/glesys/default.nix14
1 files changed, 6 insertions, 8 deletions
diff --git a/ops/glesys/default.nix b/ops/glesys/default.nix
index 80a86fec70c9..e511e1f6b686 100644
--- a/ops/glesys/default.nix
+++ b/ops/glesys/default.nix
@@ -6,12 +6,10 @@ depot.nix.readTree.drvTargets rec {
     depot.third_party.terraform-provider-glesys
   ]);
 
-  validate = pkgs.runCommand "tf-validate-glesys"
-    {
-      GLESYS_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 = "glesys";
+    src = lib.cleanSource ./.;
+    env.GLESYS_TOKEN = "ci-dummy";
+  };
 }