Skip to content

Commit cc7fd8e

Browse files
authored
Merge pull request #262 from code0-tech/fix-cygnus-and-new-env-var
Fix cygnus and add new env var
2 parents fd7879f + a23707a commit cc7fd8e

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

modules/docker/cygnus/cygnus.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ resource "random_password" "payload_user_password" {
1515
length = 32
1616
}
1717

18+
data "gitlab_project_variable" "ga_measurement_id" {
19+
project = "code0-tech/secret-manager"
20+
key = "SCULPTOR_NEXT_PUBLIC_GA_MEASUREMENT_ID"
21+
}
22+
1823
locals {
1924
cygnus_env = [
2025
# Cygnus
@@ -23,6 +28,7 @@ locals {
2328
"PAYLOAD_USER_PASS=${random_password.payload_user_password.result}",
2429
"DATABASE_URL=postgresql://cygnus:${random_password.db.result}@${docker_container.postgres.hostname}:5432/payload",
2530
"HOSTNAME=0.0.0.0",
31+
"NEXT_PUBLIC_GA_MEASUREMENT_ID=${sensitive(data.gitlab_project_variable.ga_measurement_id.value)}",
2632

2733
# Proxy
2834
"VIRTUAL_HOST=${var.web_url}"

modules/docker/cygnus/postgres.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ resource "docker_image" "postgres" {
99

1010
resource "docker_volume" "pgdata" {
1111
name = "cygnus_pgdata"
12+
13+
lifecycle {
14+
replace_triggered_by = [
15+
docker_image.cygnus.image_id,
16+
docker_image.postgres.image_id
17+
]
18+
}
1219
}
1320

1421
resource "random_password" "db" {
@@ -43,4 +50,10 @@ resource "docker_container" "postgres" {
4350
networks_advanced {
4451
name = docker_network.cygnus.name
4552
}
53+
54+
lifecycle {
55+
replace_triggered_by = [
56+
docker_volume.pgdata.id
57+
]
58+
}
4659
}

0 commit comments

Comments
 (0)