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

16 lines
429 B
Nix

{ depot, lib, pkgs, ... }:
depot.nix.readTree.drvTargets rec {
terraform = pkgs.terraform.withPlugins (p: [
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
'';
}