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:
parent
af44916312
commit
fceb3fef73
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue