diff --git a/qa-api.nomad b/qa-api.nomad new file mode 100644 index 0000000..7587b8e --- /dev/null +++ b/qa-api.nomad @@ -0,0 +1,150 @@ +variable "ghcr_token" { + type = string + description = "Github Container Registry Auth Token" +} + +job "qa" { + datacenters = ["dc1"] + type = "service" + + update { + max_parallel = 2 + min_healthy_time = "10s" + healthy_deadline = "15m" + progress_deadline = "20m" + auto_revert = true + auto_promote = true + canary = 1 + } + + migrate { + max_parallel = 2 + health_check = "checks" + min_healthy_time = "10s" + healthy_deadline = "15m" + } + + group "db" { + affinity { + attribute = "${attr.kernel.arch}" + value = "x86_64" + weight = 75 + } + network { + port "db" { + to = 27017 + } + } + + service { + // provider = "nomad" + name = "mongo" + port = "db" + check { + name = "mongo server" + type = "tcp" + interval = "20s" + timeout = "8s" + } + } + + task "mongo" { + driver = "docker" + + constraint { + attribute = "${attr.kernel.arch}" + operator = "set_contains_any" + value = "aarch64,x86_64" + } + + config { + image = "mongodb/mongodb-community-server:5.0.10-ubuntu2004" + ports = ["db"] + image_pull_timeout = "10m" + } + + vault {} + + template { + data = <