Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4088ab0
Bump Vault provider to 5.0 and prevent leaking local TF artifacts int…
filippo-20tab Apr 29, 2026
9e0e7f6
Replace Terraform with OpenTofu and rename terraform/ dir to tofu/
filippo-20tab Apr 29, 2026
1124f18
Exclude .terraform.lock.hcl from Docker build context
filippo-20tab Apr 29, 2026
d76e295
Use any for var.secrets to allow heterogeneous payloads
filippo-20tab Apr 29, 2026
5098250
Serialize TFC workspace creation to avoid tfe provider race on projec…
filippo-20tab Apr 29, 2026
5d6ca98
Upgrade common requirements
filippo-20tab Apr 29, 2026
d770a67
Propagate subrepo failures so dump is preserved on rollback
filippo-20tab Apr 29, 2026
65b296d
Honor BACKEND_TEMPLATE_URL_* and FRONTEND_TEMPLATE_URL_* env vars
filippo-20tab Apr 29, 2026
dd6f24e
Skip TFC project creation in subrepos and rollback parent resources o…
filippo-20tab Apr 29, 2026
7393b48
Add platform compose, Traefik proxy and self-signed TLS to scaffolding
filippo-20tab Apr 29, 2026
73330fa
Collect AWS OIDC role and region and template platform CI matrix from…
filippo-20tab May 4, 2026
4c76856
Rename redis references to valkey across collector, runner, CLI and docs
filippo-20tab May 4, 2026
941238d
Nest core_providers under resources so extra_context can override it …
filippo-20tab May 5, 2026
488434f
Fix scaffolded compose env vars and modernize docker compose subcommand
filippo-20tab May 5, 2026
66af032
Point frontend compose service to docker/local.Dockerfile
filippo-20tab May 5, 2026
fc1a55b
Align scaffolded .env_template with gs1-tendenze: domains, POSTGRES_H…
filippo-20tab May 5, 2026
8d8c321
Merge remote-tracking branch 'origin/main' into hotfix/post-1175-misc…
filippo-20tab May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
**/__pycache__
**/lost+found
**/.terraform
**/.terraform.lock.hcl
**/terraform.tfstate
**/terraform.tfstate.backup
**/terraform.tfvars
**/terraform.tfvars.json
**/*.auto.tfvars
**/*.auto.tfvars.json
*.md
.*
Dockerfile
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG OUTPUT_BASE_DIR=/data
ENV OUTPUT_BASE_DIR=${OUTPUT_BASE_DIR}
WORKDIR /app
ARG OPENTOFU_VERSION=1.10.6
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
curl \
git \
gnupg \
libpq-dev \
software-properties-common \
&& curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg \
&& gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint \
&& echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list \
&& apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
terraform \
unzip \
&& curl -fsSL https://get.opentofu.org/install-opentofu.sh -o /tmp/install-opentofu.sh \
&& chmod +x /tmp/install-opentofu.sh \
&& /tmp/install-opentofu.sh --install-method standalone --opentofu-version "${OPENTOFU_VERSION}" \
&& rm /tmp/install-opentofu.sh \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements/common.txt requirements/common.txt
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools \
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Staging environment complete URL [https://stage.my-project-name.com]:
Production environment complete URL [https://www.my-project-name.com]:
Do you want Traefik to generate SSL certificates? [Y/n]:
Let's Encrypt certificates email: info@my-organization-email.com
Do you want to use Redis? [y/N]:
Do you want to use Valkey? [y/N]:
Kubernetes cluster DigitalOcean region [fra1]:
Database cluster DigitalOcean region [fra1]:
Database cluster node size [db-s-1vcpu-2gb]:
Expand Down Expand Up @@ -322,16 +322,16 @@ else use

`--project-url-monitoring=https://logs.example.org/`

#### Redis
#### Valkey

For enabling redis integration the following arguments are needed:
For enabling valkey integration the following arguments are needed:

`--use-redis`<br/>
`--digitalocean-redis-cluster-region=fra1`<br/>
`--digitalocean-redis-cluster-node-size=db-s-1vcpu-2gb`
`--use-valkey`<br/>
`--digitalocean-valkey-cluster-region=fra1`<br/>
`--digitalocean-valkey-cluster-node-size=db-s-1vcpu-2gb`

Disabled args
`--no-redis`
`--no-valkey`

### ☸️ Other Kubernetes

Expand All @@ -354,9 +354,9 @@ Disabled args
`--postgres-persistent-volume-claim-capacity=""`
`--postgres-persistent-volume-host-path={{postgres-persistent-volume-host-path}}`

#### Redis
#### Valkey

`--redis-image=redis:6.2`
`--valkey-image=valkey/valkey:8`

### 🦊 GitLab

Expand Down
67 changes: 44 additions & 23 deletions bootstrap/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
BACKEND_TYPE_CHOICES,
BACKEND_TYPE_DEFAULT,
CLUSTERS_DEFAULT,
CORE_PROVIDER_AWS,
CORE_PROVIDER_CHOICES,
CORE_PROVIDER_DIGITALOCEAN,
DIGITALOCEAN_DATABASE_CLUSTER_NODE_SIZE_DEFAULT,
DIGITALOCEAN_REDIS_CLUSTER_NODE_SIZE_DEFAULT,
DIGITALOCEAN_SPACES_REGION_DEFAULT,
DIGITALOCEAN_VALKEY_CLUSTER_NODE_SIZE_DEFAULT,
EMPTY_SERVICE_TYPE,
ENV_NAMES,
ENV_TO_CLUSTER_DEFAULT,
Expand Down Expand Up @@ -68,6 +69,8 @@ class Collector:
clusters: list[str] | None = None
cluster_core_providers: dict[str, list[str]] | None = None
env_to_cluster: dict[str, str] | None = None
aws_role_arn: str | None = None
aws_region: str | None = None
project_domain: str | None = None
subdomain_dev: str | None = None
subdomain_stage: str | None = None
Expand All @@ -86,10 +89,10 @@ class Collector:
postgres_persistent_volume_capacity: str | None = None
postgres_persistent_volume_claim_capacity: str | None = None
postgres_persistent_volume_host_path: str | None = None
use_redis: bool | None = None
redis_image: str | None = None
digitalocean_redis_cluster_region: str | None = None
digitalocean_redis_cluster_node_size: str | None = None
use_valkey: bool | None = None
valkey_image: str | None = None
digitalocean_valkey_cluster_region: str | None = None
digitalocean_valkey_cluster_node_size: str | None = None
sentry_org: str | None = None
sentry_url: str | None = None
sentry_auth_token: str | None = None
Expand Down Expand Up @@ -130,10 +133,11 @@ def collect(self):
self.set_service_dir()
self.set_backend_service()
self.set_frontend_service()
self.set_use_redis()
self.set_use_valkey()
self.set_terraform()
self.set_vault()
self.set_clusters()
self.set_aws()
self.set_envs()
self.set_domain_and_urls()
self.set_letsencrypt()
Expand Down Expand Up @@ -201,11 +205,11 @@ def set_frontend_service(self):
separator="",
)

def set_use_redis(self):
"""Set the use Redis option."""
if self.use_redis is None:
self.use_redis = click.confirm(
warning("Do you want to use Redis?"), default=False
def set_use_valkey(self):
"""Set the use Valkey option."""
if self.use_valkey is None:
self.use_valkey = click.confirm(
warning("Do you want to use Valkey?"), default=False
)

def set_terraform(self):
Expand Down Expand Up @@ -289,6 +293,21 @@ def set_clusters(self):
if p.strip().lower() in CORE_PROVIDER_CHOICES
]

def set_aws(self):
"""Set AWS-specific options when AWS is among the chosen core providers."""
uses_aws = any(
CORE_PROVIDER_AWS in providers
for providers in (self.cluster_core_providers or {}).values()
)
if not uses_aws:
return
self.aws_role_arn = self.aws_role_arn or click.prompt(
"AWS IAM role ARN for GitLab OIDC federation"
)
self.aws_region = self.aws_region or click.prompt(
"AWS region", default=AWS_S3_REGION_DEFAULT
)

def set_envs(self):
"""Set the environment-to-cluster mapping (one cluster slug per environment)."""
self.env_to_cluster = self.env_to_cluster or {}
Expand Down Expand Up @@ -388,15 +407,15 @@ def set_digitalocean(self):
default=DIGITALOCEAN_DATABASE_CLUSTER_NODE_SIZE_DEFAULT,
)
)
if self.use_redis:
if self.digitalocean_redis_cluster_region is None:
self.digitalocean_redis_cluster_region = click.prompt(
"Redis cluster DigitalOcean region", default="fra1"
if self.use_valkey:
if self.digitalocean_valkey_cluster_region is None:
self.digitalocean_valkey_cluster_region = click.prompt(
"Valkey cluster DigitalOcean region", default="fra1"
)
if self.digitalocean_redis_cluster_node_size is None:
self.digitalocean_redis_cluster_node_size = click.prompt(
"Redis cluster node size",
default=DIGITALOCEAN_REDIS_CLUSTER_NODE_SIZE_DEFAULT,
if self.digitalocean_valkey_cluster_node_size is None:
self.digitalocean_valkey_cluster_node_size = click.prompt(
"Valkey cluster node size",
default=DIGITALOCEAN_VALKEY_CLUSTER_NODE_SIZE_DEFAULT,
)

def set_digitalocean_token(self):
Expand Down Expand Up @@ -572,6 +591,8 @@ def get_runner(self):
clusters=self.clusters,
cluster_core_providers=self.cluster_core_providers,
env_to_cluster=self.env_to_cluster,
aws_role_arn=self.aws_role_arn,
aws_region=self.aws_region,
project_domain=self.project_domain,
subdomain_dev=self.subdomain_dev,
subdomain_stage=self.subdomain_stage,
Expand All @@ -590,10 +611,10 @@ def get_runner(self):
postgres_persistent_volume_capacity=self.postgres_persistent_volume_capacity,
postgres_persistent_volume_claim_capacity=self.postgres_persistent_volume_claim_capacity,
postgres_persistent_volume_host_path=self.postgres_persistent_volume_host_path,
use_redis=self.use_redis,
redis_image=self.redis_image,
digitalocean_redis_cluster_region=self.digitalocean_redis_cluster_region,
digitalocean_redis_cluster_node_size=self.digitalocean_redis_cluster_node_size,
use_valkey=self.use_valkey,
valkey_image=self.valkey_image,
digitalocean_valkey_cluster_region=self.digitalocean_valkey_cluster_region,
digitalocean_valkey_cluster_node_size=self.digitalocean_valkey_cluster_node_size,
sentry_org=self.sentry_org,
sentry_url=self.sentry_url,
backend_sentry_dsn=self.backend_sentry_dsn,
Expand Down
18 changes: 14 additions & 4 deletions bootstrap/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Web project initialization CLI constants."""

import os
from pathlib import Path

BASE_DIR = Path(__file__).parent.parent
Expand Down Expand Up @@ -32,12 +33,21 @@
# Subrepos

BACKEND_TEMPLATE_URLS = {
"django": "https://github.com/20tab/django-continuous-delivery"
"django": os.environ.get(
"BACKEND_TEMPLATE_URL_DJANGO",
"https://github.com/20tab/django-continuous-delivery",
),
}

FRONTEND_TEMPLATE_URLS = {
"nextjs": "https://github.com/20tab/nextjs-continuous-delivery",
"nextjs-light": "https://github.com/20tab/nextjs-light-continuous-delivery",
"nextjs": os.environ.get(
"FRONTEND_TEMPLATE_URL_NEXTJS",
"https://github.com/20tab/nextjs-continuous-delivery",
),
"nextjs-light": os.environ.get(
"FRONTEND_TEMPLATE_URL_NEXTJS_LIGHT",
"https://github.com/20tab/nextjs-light-continuous-delivery",
),
}

SUBREPOS_DIR = Path(__file__).parent.parent / ".subrepos"
Expand All @@ -62,7 +72,7 @@

DIGITALOCEAN_DATABASE_CLUSTER_NODE_SIZE_DEFAULT = "db-s-1vcpu-2gb"

DIGITALOCEAN_REDIS_CLUSTER_NODE_SIZE_DEFAULT = "db-s-1vcpu-2gb"
DIGITALOCEAN_VALKEY_CLUSTER_NODE_SIZE_DEFAULT = "db-s-1vcpu-2gb"

DIGITALOCEAN_SPACES_REGION_DEFAULT = "fra1"

Expand Down
Loading
Loading