Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
dependency "deployment" {
config_path = "../"
}

# Hub coordinates: single source of truth in the sibling deployment's hub.hcl.
include "hub" {
path = "../hub.hcl"
expose = true
}

terraform {
source = "git::https://github.com/meshcloud/meshstack-hub.git//modules/${include.hub.locals.module}/e2e?ref=${include.hub.locals.git_ref}"
}

generate "provider" {
path = "provider.tf"
if_exists = "overwrite"
contents = <<EOF
provider "meshstack" {
endpoint = "https://api.try.meshstack.io"
apikey = "${get_env("MESHSTACK_STARTER_KIT_API_KEY_ID")}"
apisecret = "${get_env("MESHSTACK_STARTER_KIT_API_KEY_SECRET")}"
}
EOF
}

# `tofu test` does not type-decode complex TF_VAR_* env vars — use auto.tfvars.json so the
# structured `test_context` variable arrives correctly typed in test assertion scope.
#
# Foundation mode: the deployment (`../`) already created the BBD, so we set `bbd_version_ref` to
# order an ephemeral building block against it. That also means none of the build-from-source
# fixtures (forgejo, DNS zone) or backplane secrets are passed — the e2e module builds no backplane
# here. See the meshstack-hub `e2e-test` skill for the invocation protocol.
generate "smoke_tfvars" {
path = "smoke.auto.tfvars.json"
if_exists = "overwrite"
disable_signature = true
contents = jsonencode({
test_context = {
workspace = dependency.deployment.outputs.e2e.owning_workspace
name_suffix = run_cmd("--terragrunt-quiet", "date", "-u", "+%Y%m%d%H%M%S")
hub_git_ref = dependency.deployment.outputs.e2e.hub.git_ref
bbd_version_ref = { uuid = dependency.deployment.outputs.e2e.building_block_definition.version_ref.uuid }
}
})
}
12 changes: 12 additions & 0 deletions foundations/meshstack-trial/platforms/ske/starterkit/hub.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Hub building-block coordinates — single source of truth for both the deployment
# (terragrunt.hcl) and the e2e smoke test (e2e/terragrunt.hcl).
#
# `module` is only consumed by e2e/: the deployment composes three hub modules (the starter kit and
# the two definitions it creates child building blocks from), so it names their paths itself.
locals {
module = "ske/ske-starterkit"
git_ref = "2baf183189d4207ccbd22ff5d5b5334a7cbcc8fa"

# Released, not draft — the e2e test orders against `version_latest_release`.
bbd_draft = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Consumed by e2e/ to order an ephemeral building block against the deployed definition.
output "e2e" {
value = {
hub = var.hub
building_block_definition = module.starterkit.building_block_definition
owning_workspace = var.meshstack.owning_workspace_identifier
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ dependency "dns" {
config_path = "../dns"
}

locals {
hub = {
git_ref = "b7ac0aa9818db730958f64e7ba0fdeecedcfbd4e"
bbd_draft = false
}
# Hub coordinates live in hub.hcl (single source of truth, shared with e2e/).
include "hub" {
path = "./hub.hcl"
expose = true
}

generate "provider" {
Expand All @@ -48,7 +47,10 @@ EOF

inputs = {
meshstack = dependency.meshstack.outputs
hub = local.hub
hub = {
git_ref = include.hub.locals.git_ref
bbd_draft = include.hub.locals.bbd_draft
}

platform_ref = dependency.platform.outputs.platform_ref
landing_zone_refs = dependency.platform.outputs.landing_zone_refs
Expand Down