From f77c486bf194fed79f1cf37a226cbdb18fe22a05 Mon Sep 17 00:00:00 2001 From: Valentin Matton Date: Mon, 2 Oct 2023 12:35:46 +0200 Subject: [PATCH] chore: set stack version --- .github/workflows/deployment.yml | 2 +- deployment/docker-compose.yml | 4 ++-- deployment/main.tf | 6 +++--- deployment/modules/stack_data/main.tf | 2 +- deployment/modules/stack_data/variables.tf | 4 ++-- deployment/template.terraform.tfvars.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index bf63a9a33..82477339a 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -40,7 +40,7 @@ jobs: TF_VAR_airflow_secret_key: ${{ secrets.AIRFLOW_SECRET_KEY }} TF_VAR_airflow_admin_password: ${{ secrets.AIRFLOW_ADMIN_PASSWORD }} TF_VAR_api_secret_key: ${{ secrets.api_secret_key }} - TF_VAR_api_version: pr-63 # TODO + TF_VAR_stack_version: ${{ github.sha }} TF_VAR_ssh_private_key: ${{ secrets.ssh_private_key }} TF_VAR_public_hostname: ${{ vars.PUBLIC_HOSTNAME }} TF_VAR_airflow__core__fernet_key: ${{ secrets.AIRFLOW__CORE__FERNET_KEY }} diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index 3965aa5aa..7c0dad684 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -117,7 +117,7 @@ services: - ../pipeline/dbt:/usr/app datawarehouse: - image: postgis/postgis:14-3.3 + image: ghcr.io/betagouv/data-inclusion-datawarehouse:${STACK_VERSION} restart: on-failure healthcheck: test: [ "CMD", "pg_isready", "-U", "${DATAWAREHOUSE_DI_USERNAME}"] @@ -133,7 +133,7 @@ services: - datawarehouse-data:/var/lib/postgresql/data api: - image: ghcr.io/betagouv/data-inclusion-api:${API_VERSION} + image: ghcr.io/betagouv/data-inclusion-api:${STACK_VERSION} depends_on: - datawarehouse restart: always diff --git a/deployment/main.tf b/deployment/main.tf index 9cd708788..9c11f1abb 100644 --- a/deployment/main.tf +++ b/deployment/main.tf @@ -77,8 +77,8 @@ variable "api_secret_key" { sensitive = true } -variable "api_version" { - description = "Version (e.g. sha or semver) of the api to deploy" +variable "stack_version" { + description = "Version (e.g. sha or semver) of the stack services to deploy" type = string } @@ -127,7 +127,7 @@ module "stack_data" { environment = var.environment airflow_admin_password = var.airflow_admin_password api_secret_key = var.api_secret_key - api_version = var.api_version + stack_version = var.stack_version ssh_private_key = var.ssh_private_key public_hostname = var.public_hostname airflow__core__fernet_key = var.airflow__core__fernet_key diff --git a/deployment/modules/stack_data/main.tf b/deployment/modules/stack_data/main.tf index 8b9979b5c..5315f0e3f 100644 --- a/deployment/modules/stack_data/main.tf +++ b/deployment/modules/stack_data/main.tf @@ -120,7 +120,7 @@ resource "null_resource" "up" { provisioner "file" { content = sensitive(<<-EOT - API_VERSION=${var.api_version} + STACK_VERSION=${var.stack_version} AIRFLOW_CONN_PG=${local.airflow_conn_pg} AIRFLOW_CONN_S3=${local.airflow_conn_s3} AIRFLOW__CORE__FERNET_KEY=${var.airflow__core__fernet_key} diff --git a/deployment/modules/stack_data/variables.tf b/deployment/modules/stack_data/variables.tf index 88d1220ad..d4d55c8e6 100644 --- a/deployment/modules/stack_data/variables.tf +++ b/deployment/modules/stack_data/variables.tf @@ -77,8 +77,8 @@ variable "api_secret_key" { sensitive = true } -variable "api_version" { - description = "Version (e.g. sha or semver) of the api to deploy" +variable "stack_version" { + description = "Version (e.g. sha or semver) of the stack services to deploy" type = string } diff --git a/deployment/template.terraform.tfvars.json b/deployment/template.terraform.tfvars.json index a24fa63d9..fc798ef9d 100644 --- a/deployment/template.terraform.tfvars.json +++ b/deployment/template.terraform.tfvars.json @@ -13,7 +13,7 @@ "airflow_secret_key": null, "airflow_admin_password": null, "api_secret_key": null, - "api_version": null, + "stack_version": null, "ssh_private_key": null, "public_hostname": null, "airflow__core__fernet_key": null,