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>
This commit is contained in:
parent
469189afd3
commit
af44916312
1 changed files with 11 additions and 2 deletions
|
@ -1,7 +1,16 @@
|
||||||
{ depot, pkgs, ... }:
|
{ depot, lib, pkgs, ... }:
|
||||||
|
|
||||||
depot.nix.readTree.drvTargets {
|
depot.nix.readTree.drvTargets rec {
|
||||||
terraform = pkgs.terraform.withPlugins (p: [
|
terraform = pkgs.terraform.withPlugins (p: [
|
||||||
p.buildkite
|
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
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue