Skip to content

Commit

Permalink
chore: move docker-compose.yml into stack_data module
Browse files Browse the repository at this point in the history
Also upload to just `/root/data-inclusion`, the `/deployment` subdirectory
is now unnecessary on the target.
  • Loading branch information
jonathanperret committed Oct 5, 2023
1 parent 668a3da commit 152aee1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
File renamed without changes.
13 changes: 6 additions & 7 deletions deployment/modules/stack_data/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ locals {
var.airflow_secret_key
)


work_dir = "/root/data-inclusion"
}

Expand All @@ -147,7 +146,7 @@ resource "null_resource" "up" {
provisioner "remote-exec" {
inline = [
"rm -rf ${local.work_dir}",
"mkdir -p ${local.work_dir}/deployment",
"mkdir -p ${local.work_dir}",
]
}

Expand Down Expand Up @@ -177,20 +176,20 @@ resource "null_resource" "up" {
API_TOKEN_ENABLED=${var.api_token_enabled}
EOT
)
destination = "${local.work_dir}/deployment/.env"
destination = "${local.work_dir}/.env"
}

provisioner "file" {
source = "${path.root}/docker-compose.yml"
destination = "${local.work_dir}/deployment/docker-compose.yml"
source = "${path.module}/docker-compose.yml"
destination = "${local.work_dir}/docker-compose.yml"
}

provisioner "remote-exec" {
inline = [
"cd ${local.work_dir}/deployment",
"cd ${local.work_dir}",
"docker compose --progress=plain up --pull=always --force-recreate --wait --wait-timeout 1200 --quiet-pull --detach",
# FIXME: ideally this file should be removed
# "rm -f ${local.work_dir}/deployment/.env",
# "rm -f ${local.work_dir}/.env",
]
}
}

0 comments on commit 152aee1

Please sign in to comment.