From 794dbed8cb9c4a035f0c788d593e6b66d77c55df Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Tue, 19 Dec 2023 20:02:31 -0500 Subject: [PATCH] use glue dashboards, fix tests Signed-off-by: Jason Hall --- apps.tf | 6 +++++- cmd/flatten/test.sh | 4 ++-- main.tf | 6 ++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps.tf b/apps.tf index 7a99a8d..f471074 100644 --- a/apps.tf +++ b/apps.tf @@ -126,8 +126,12 @@ resource "google_dns_record_set" "dns-record" { } resource "null_resource" "test" { - for_each = local.apps + for_each = tomap(local.apps) depends_on = [google_dns_record_set.dns-record] + + # Changes to any service requires re-testing it. + triggers = { service = google_cloud_run_service.service[each.key].id } + provisioner "local-exec" { command = file("${path.module}/cmd/${each.key}/test.sh") } } diff --git a/cmd/flatten/test.sh b/cmd/flatten/test.sh index b4c664f..3b07edf 100755 --- a/cmd/flatten/test.sh +++ b/cmd/flatten/test.sh @@ -2,5 +2,5 @@ set -eux -time crane validate --remote=flatten.kontain.me/busybox -time crane validate --remote=flatten.kontain.me/busybox +time crane validate --remote=flatten.kontain.me/cgr.dev/chainguard/busybox:latest-glibc +time crane validate --remote=flatten.kontain.me/cgr.dev/chainguard/busybox:latest-glibc diff --git a/main.tf b/main.tf index 6f8c9ee..da93868 100644 --- a/main.tf +++ b/main.tf @@ -31,10 +31,8 @@ variable "domain" { } module "dashboard" { - for_each = tomap(tomap(local.apps)) - source = "github.com/chainguard-dev/terraform-cloudrun-dashboard" - - project_id = var.project_id + for_each = tomap(local.apps) + source = "git::https://github.com/chainguard-dev/terraform-cloudrun-glue//dashboard/service?ref=main" service_name = each.key }