variable "app" {
type = string
default = "api"
}
variable "version" {
type = string
}
variable "env" {
type = string
default = "staging"
}
variable "build_timestamp" {
description = "RFC 3339 build timestamp"
type = string
}
computed "deploy_payload" {
description = "JSON payload for the deployment API"
expression = jsonencode({
application = var.app
version = var.version
environment = var.env
deployed_at = var.build_timestamp
})
}
task "notify-deploy" {
description = "Record the deployment in the release tracker"
commands = [
"curl -X POST https://releases.example.com/api/deploys -H 'Content-Type: application/json' -d '${computed.deploy_payload}'",
]
}