variable "app" {
type = string
default = "api"
}
variable "version" {
type = string
}
computed "dashboard_url" {
description = "Grafana link filtered to this release"
expression = "https://grafana.example.com/d/overview?var-app=${urlencode(var.app)}&var-version=${urlencode(var.version)}&from=now-1h"
}
task "post-release" {
description = "Post release info with dashboard link"
commands = [
"curl -X POST https://slack.example.com/webhook -d '{\"text\": \"Deployed ${var.app} ${var.version}: ${computed.dashboard_url}\"}'",
]
}