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
This commit is contained in:
Vincent Ambo 2022-06-03 23:15:13 +00:00 committed by tazjin
parent af44916312
commit fceb3fef73

View file

@ -1,8 +1,17 @@
{ depot, pkgs, ... }:
{ depot, lib, pkgs, ... }:
depot.nix.readTree.drvTargets {
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
'';
}