Skip to content

Commit

Permalink
chore: set stack version
Browse files Browse the repository at this point in the history
  • Loading branch information
vmttn committed Oct 2, 2023
1 parent 5ee64db commit f77c486
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deployment/modules/stack_data/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions deployment/modules/stack_data/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion deployment/template.terraform.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f77c486

Please sign in to comment.