feat: add health check
This commit is contained in:
@@ -7,7 +7,8 @@ resource "terraform_data" "docker_compose_deploy" {
|
||||
var.vm_ip,
|
||||
dirname(var.destination_path),
|
||||
var.ssh_user,
|
||||
var.start_delay_seconds
|
||||
var.start_delay_seconds,
|
||||
var.health_check_command
|
||||
]
|
||||
|
||||
connection {
|
||||
@@ -30,7 +31,8 @@ resource "terraform_data" "docker_compose_deploy" {
|
||||
"export INFISICAL_API_URL=\"https://secrets.itlab-ffeks.dnu.edu.ua\"",
|
||||
"export INFISICAL_DISABLE_UPDATE_CHECK=true",
|
||||
"infisical run --env=\"${self.triggers_replace[2]}\" -- docker compose up -d",
|
||||
"sleep ${self.triggers_replace[7]}"
|
||||
"sleep ${self.triggers_replace[7]}",
|
||||
self.triggers_replace[8] != "" ? "timeout 60s bash -c 'until ${self.triggers_replace[8]}; do sleep 1; done'" : "true"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -43,3 +43,10 @@ variable "start_delay_seconds" {
|
||||
default = 10
|
||||
}
|
||||
|
||||
variable "health_check_command" {
|
||||
type = string
|
||||
description = "Optional health check command to run on the VM to wait for the service to be ready"
|
||||
default = ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user