From 152aee1c2d18a0fd17a57bb6bef4d4e9861c70b4 Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Thu, 5 Oct 2023 18:35:02 +0200 Subject: [PATCH] chore: move docker-compose.yml into stack_data module Also upload to just `/root/data-inclusion`, the `/deployment` subdirectory is now unnecessary on the target. --- .../{ => modules/stack_data}/docker-compose.yml | 0 deployment/modules/stack_data/main.tf | 13 ++++++------- 2 files changed, 6 insertions(+), 7 deletions(-) rename deployment/{ => modules/stack_data}/docker-compose.yml (100%) diff --git a/deployment/docker-compose.yml b/deployment/modules/stack_data/docker-compose.yml similarity index 100% rename from deployment/docker-compose.yml rename to deployment/modules/stack_data/docker-compose.yml diff --git a/deployment/modules/stack_data/main.tf b/deployment/modules/stack_data/main.tf index 2c369543a..f02746a8b 100644 --- a/deployment/modules/stack_data/main.tf +++ b/deployment/modules/stack_data/main.tf @@ -128,7 +128,6 @@ locals { var.airflow_secret_key ) - work_dir = "/root/data-inclusion" } @@ -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}", ] } @@ -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", ] } }