tvl-depot/ops/glesys/default.nix
Vincent Ambo fceb3fef73 test(ops/glesys): Validate Terraform configuration in CI
Change-Id: I8d251d3ee1de77feca865d0a677041c9c485d211
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5843
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2022-06-06 11:05:12 +00:00

17 lines
518 B
Nix

{ depot, lib, pkgs, ... }:
depot.nix.readTree.drvTargets rec {
# Provide a Terraform wrapper with the right provider installed.
terraform = pkgs.terraform.withPlugins (_: [
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
'';
}