Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

52 lines (42 sloc) 1.14 KB
resource "null_resource" "dockerrm" {
provisioner "local-exec" {
command = "docker kill $(docker inspect --format={{.Id}} terraform-helmfile) && docker rm $(docker inspect --format={{.Id}} terraform-helmfile) || true"
}
triggers = {
always_run = "${timestamp()}"
}
}
resource "docker_container" "helmfile" {
name = "terraform-helmfile"
image = "quay.io/roboll/helmfile:v0.80.2"
links = ["k3s-server"]
entrypoint = ["/entrypoint.sh"]
start = true
upload = {
content = "${data.template_file.entrypoint.rendered}"
file = "/entrypoint.sh"
executable = true
}
upload = {
content = "${data.template_file.kubeconfig.rendered}"
file = "/kubeconfig.yaml"
}
upload = {
content = "${data.template_file.helmfile.rendered}"
file = "/helmfile.yaml"
}
depends_on = [
"null_resource.dockerrm",
]
}
resource "null_resource" "dockerlogs" {
provisioner "local-exec" {
command = "./logtail.py $(docker inspect --format={{.Id}} terraform-helmfile)"
}
triggers = {
always_run = "${timestamp()}"
}
depends_on = [
"docker_container.helmfile",
]
}
You can’t perform that action at this time.